Экспорт:
Папки
/root/polzovateli/var_null/internet-resursi/socialnie-seti/vkcom/API-metodi/soobshheniya
Не экспортировать закрытые директории
Преобразовывать заметки в html
Экспортировать
Применить |
| 2016-11-03 11:48:09 |
<?php
$f = fopen("ids.txt", "r");//ids For ex: 1,2,3,4,5
$access_token = 'TOKEN';//token
$ids = '';
while(!feof($f)) {
$ids .= fgets($f);
}
fclose($f);
$return_mas = array();
$postvars = "user_ids=" . $ids . "&access_token=" . $access_token . "&fields=can_write_private_message";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.vk.com/method/users.get");
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
curl_setopt( $ch, CURLOPT_SSL_VERIFYHOST, false );
curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, 0 );
curl_setopt($ch, CURLOPT_POSTFIELDS, $postvars);
$con = curl_exec($ch);
curl_close($ch);
$data_mas = json_decode($con, true);
$response_mas = $data_mas['response'];
$count_response = count($response_mas);
echo $count_response;
$str = '';
for($k = 0; $k < $count_response; $k++)
{
if($response_mas[$k]['can_write_private_message'] == 0)
{
$str .= 'id' . $response_mas[$k]['uid'] . ',';
}
}
$fp = fopen("ids_2.txt", 'a');//file result
$trace = fwrite($fp, $str);
fclose($fp);
?>
$f = fopen("ids.txt", "r");//ids For ex: 1,2,3,4,5
$access_token = 'TOKEN';//token
$ids = '';
while(!feof($f)) {
$ids .= fgets($f);
}
fclose($f);
$return_mas = array();
$postvars = "user_ids=" . $ids . "&access_token=" . $access_token . "&fields=can_write_private_message";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.vk.com/method/users.get");
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
curl_setopt( $ch, CURLOPT_SSL_VERIFYHOST, false );
curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, 0 );
curl_setopt($ch, CURLOPT_POSTFIELDS, $postvars);
$con = curl_exec($ch);
curl_close($ch);
$data_mas = json_decode($con, true);
$response_mas = $data_mas['response'];
$count_response = count($response_mas);
echo $count_response;
$str = '';
for($k = 0; $k < $count_response; $k++)
{
if($response_mas[$k]['can_write_private_message'] == 0)
{
$str .= 'id' . $response_mas[$k]['uid'] . ',';
}
}
$fp = fopen("ids_2.txt", 'a');//file result
$trace = fwrite($fp, $str);
fclose($fp);
?>