public function receive($message) { if ($message->type == "location") { $forecast = false; $coords = array("lon" => $message->location->longitude, "lat" => $message->location->latitude); $wp = new WeatherParser($coords); Api::reply($message->chat, $wp->getWeather($forecast), true); } }
exit('Not installed curl!'); } if(!check_last_post()) { exit('Already posted!'); } $vk = new vk_auth($VKEMAIL, $VKPWD, $VKPPID, $SLEEPTIME); if(!$vk->check_auth()) { exit('Error! See logfile.'); } $weather = new WeatherParser($CITY); $message = $weather->get_data(); if (!$vk->post_to_wall($message)) { exit('Error! Not Posted!'); } else { write_last_post(); echo 'Posted!'; } ?>