예제 #1
0
 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);
     }
 }
예제 #2
0
파일: vk_post.php 프로젝트: nekto/vkweather
	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!';
}


?>