", "");
// echo $my_plaze;
$ch2 = curl_init();
$cmd2="plazes/" . $my_plaze . ".xml";
curl_setopt($ch2, CURLOPT_URL, "http://www.plazes.com/".$cmd2);
curl_setopt($ch2, CURLOPT_USERPWD, $plazes_cred);
curl_setopt($ch2, CURLOPT_HTTPHEADER, Array("Content-Type: application/xml"));
curl_setopt($ch2, CURLOPT_HTTPHEADER, Array("Accept: application/xml"));
curl_setopt($ch2, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch2, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($ch2, CURLOPT_SSL_VERIFYPEER, 0);
$data2 = curl_exec($ch2);
// echo $data2;
$city = get_string_between($data2, "", "");
$country_code = get_string_between($data2, "", "");
$lat = get_string_between($data2, "", "");
$long = get_string_between($data2, "", "");
$plaze_name = get_string_between($data2, "", "");
//echo $city ." - ". $country_code ." - ". $lat ." - ". $long;
// upcoming.yahoo.com section
// http://upcoming.yahooapis.com/services/rest/?api_key=&method=event.search&search_text=killers&metro_id=1
$ch3 = curl_init();
$cmd3 = "http://upcoming.yahooapis.com/services/rest/?api_key=" . $api_upcoming . "&method=event.search&radius=".$up_radius."&location=" . $lat ."," . $long.'&min_date='.$min_date.'&max_date='.$max_date;
//echo $cmd3;
//echo "\n";
curl_setopt($ch3, CURLOPT_URL, $cmd3);
curl_setopt($ch3, CURLOPT_HTTPHEADER, Array("Content-Type: application/xml"));
curl_setopt($ch3, CURLOPT_HTTPHEADER, Array("Accept: application/xml"));
curl_setopt($ch3, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch3, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($ch3, CURLOPT_SSL_VERIFYPEER, 0);
$data3 = curl_exec($ch3);
//echo $data3;
$event_count = substr_count($data3, '\n";
if ($event_count == 0) { echo "No Events on upcoming for today near Plaze ".$plaze_name." :(";
} else {
echo "There are " .$event_count. " events near Plaze:" . $plaze_name ."
";
foreach ($xml->event as $event) {
foreach($event->attributes() as $a => $b)
{
// echo $a,'="',$b,"\"\n";
if ($a == "name") $name = $b;
if ($a == "id") $id = $b;
}
echo "".$name."
\n";
}
}
echo " and Plazes.com
";
echo "