https://api.vk.com/method/users.get?user_id=210700286&v=5.52&access_token=полученый токен
<?php
$access_token = '';
date_default_timezone_set ('Europe/Moscow');
$hour = ceil((mktime(0,0,0, 29, 12, 2018) - time())/57400);
$time = date("H:i");
$Date = date("d.m");
echo $getLikes = curl('https://api.vk.com/method/photos.get?album_id=profile&rev=1&extended=1&count=1&access_token='.$access_token.'&v=3.0');
$getLikesJson = json_decode($getLikes,1);
$likes = $getLikesJson['response']['0']['likes']['count'];
switch (substr($hour, -1)) {
case 1: $prnt='день';
case 2: case 3: case 4: $prnt='дня';
break;
default:$prnt='день';
}
$status = 'До важного события осталось:'.$hour.' '.$prnt.' ';
echo$statusSet = curl('https://api.vk.com/method/status.set?text='.urlencode($status).'&v=3.0&access_token='.$access_token);
$jsonS = json_decode($statusSet,1);
if ($jsonS['response']=='1'){
addlog('OK');
}
else{
addlog('ERROR: '.$jsonS['error']['error_msg']);
}
function addlog($logtext){
$fp = fopen( './log.txt', 'a' );
fwrite( $fp, '['.date( 'd.m.Y H:i:s', time() ).'] '.$logtext.PHP_EOL);
}
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;
}
?>
<meta charset="utf-8">
<?php
$token = ""; // access_token
$group_id = 51204300; // ID Группы без минуса
$topic_id = 33003964; // ID Топика
$get_count = curl('https://api.vk.com/method/board.getComments?group_id='.$group_id.'&topic_id='.$topic_id.'&v=5.60&access_token='.$token);
$jsonGetCount = json_decode($get_count,true);
$count = $jsonGetCount['response']['count'];
for ($i = 1; $i <= $count; $i++) {
$get = curl('https://api.vk.com/method/board.getComments?group_id='.$group_id.'&topic_id='.$topic_id.'&offset='.$i.'&count=1&v=5.60&access_token='.$token);
$jsonGet = json_decode($get,true);
$user_id = $jsonGet['response']['items'][0]['from_id']; // ID Автора
$date = $jsonGet['response']['items'][0]['date']; // Дата в unixtime
$text = $jsonGet['response']['items'][0]['text']; // Текст
$fname = $jsonGet['response']['profiles'][0]['first_name']; // Имя Автора
$lname = $jsonGet['response']['profiles'][0]['last_name']; // Фамилия Автора
/*
ОСТАЛОСЬ ТОЛЬКО ВЫВЕСТИ ЭТО ВСЕ. ДУМАЮ САМ СПРАВИШЬСЯ
*/
}
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;
}
?>
<?php
$access_token = '';
$get = curl('https://api.vk.com/method/friends.getRequests?out=1&count=1&v=5.60&access_token='.$access_token);
$json = json_decode($get,1);
$check = $json['response']['count'];
if($check == 0) {
die ('Исходящих зявок нет.');
}
$id = $json['response']['items']['0'];
$del = curl('https://api.vk.com/method/friends.delete?user_id='.$id.'&v=5.60&access_token='.$access_token);
$ifjson = json_decode($del,1);
$ok = $ifjson['response']['out_request_deleted'];
if($ok == 1) {
echo 'Отписался от ID'.$id.'.';
}
addlog("<a href='https://vk.com/id$id'>$id</a>");
function addlog($logtext){
$fp = fopen( './del.html', 'a' );
fwrite( $fp, '<br>['.date( 'd.m.Y H:i:s', time() ).'] '.$logtext.PHP_EOL);
}
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;
}
<?php
$access_token = '';
$get = curl('https://api.vk.com/method/friends.getRequests?out=1&count=1&v=5.60&access_token='.$access_token);
$json = json_decode($get,1);
$check = $json['response']['count'];
if($check == 0) {
die();
}
$id = $json['response']['items']['0'];
$del = curl('https://api.vk.com/method/friends.delete?user_id='.$id.'&v=5.60&access_token='.$access_token);
$ifjson = json_decode($del,1);
$ok = $ifjson['response']['out_request_deleted'];
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;
}
?>