Файл: tankon.mobi/statuskavk.php
Строк: 83
<?php
$access_token = '124848f54fc26a308a7ff1a0a750859feb383ce6d9ddaeb8bbc915c41b1782897cc6c4b4bc21311aebffc'; //Нужно взять тут от айфона 133312.Tk/wall
date_default_timezone_set ('Europe/Kiev'); // http://www.php.net/manual/ru/timezones.php
$time = date("H:i");
$RequestsGet = curl('https://api.vk.com/method/friends.getRequests?need_co..' .$access_token);
$json1 = json_decode($RequestsGet,1);
$countR = $json1['response']['0'];
$messageGet = curl('https://api.vk.com/method/messages.get?access_token='.$access_token);
$json = json_decode($messageGet,1);
$countM = $json['response']['0'];
$getInfo = curl('https://api.vk.com/method/users.get?access_token='.$access_token.'&fields=uid,first_name,last_name,nickname,screen_name,sex,bdate,city,country,timezone,photo,photo_medium,photo_big,has_mobile,rate,contacts,education,online,counters');
$json2 = json_decode($getInfo,1);
$followers = $json2['response']['0']['counters']['followers'];
$fonline = $json2['response']['0']['counters']['online_friends'];
$friends = $json2['response']['0']['counters']['friends'];
$load = rand(10,90);
$weater = file_get_contents("http://informer.gismeteo.ru/xml/33429_1.xml");
$xml = xml_parser_create();
$indexes = array();
$values = array();
xml_parse_into_struct($xml,$weater, $values, $indexes);
xml_parser_free($xml);
function replace($str){
$rplc = array('0'=>"Ясно",'1'=>"Переменная облачность",'2'=>"Облачно",'3'=>"Пасмурно");
return strtr($str,$rplc);
}
function replace1($str){
$rplc=array('4'=>"Дождь",'5'=>"Ливень",'6'=>"Снег",'7'=>"Снег",'8'=>"Гроза",'9'=>"Нет данных",'10'=>"Без осадков");
return strtr($str,$rplc);
}
$wiz = $values[38][attributes][MAX];
$wiz1 = $values[4][attributes][CLOUDINESS];
$wiz2 = $values[4][attributes][PRECIPITATION];
$cloudiness = replace($wiz1);
$precipitation = replace1($wiz2);
$precipitation = replace1($wiz2);
$hour1 = ceil((mktime(0,0,0, 1, 1, 2015) - time())/3600);
$hour2 = ceil((mktime(0,0,0, 12, 1, 2014) - time())/87400);
$a1 = "$time";
$a2 = array('1', '2', '3', '4', '5', '6', '7', '8', '9', '0');
$a3 = array('1⃣', '2⃣', '3⃣', '4⃣', '5⃣', '6⃣', '7⃣', '8⃣', '9⃣', '0⃣'); // Часы и дата
$status = ''.str_replace($a2, $a3, $a1).' 🌍 В Старконе +'.$wiz.'°с ❄� до зимы �'.$hour2.' дней';
$statusSet = curl('https://api.vk.com/method/status.set?text='.urlencode($status).'&access_token='.$access_token);
$jsonS = json_decode($statusSet,1);
function curl( $url ){
$ch = curl_init( $url );
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
curl_setopt( $ch, CURLOPT_SSL_VERIFYHOST, false );
curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, false );
$response = curl_exec( $ch );
curl_close( $ch );
return $response;
}
?>