PHP Парсер новых участников любого сообщества ВКонтакте

В редакторе

PHP Парсер новых участников любого сообщества ВКонтакте

Brain_Script
961
2018-10-28 17:56:02
<? $token = ''; // токен анкеты $guid = ''; // цифровой id сообщества $page = 0; $limit = 1000; do { $offset = $page * $limit; $getlist = vkapi('groups.getMembers?group_id='.$guid.'&sort=id_asc&offset='.$offset.'&count=1000&access_token='.$token.'&v=5.64'); $json_get_all = json_decode($getlist, true); $list = $json_get_all['response']['items']; $countcomm = $json_get_all['response']['count']; if (!is_array($collectuids)) { $collectuids = $list; } if (is_array($collectuids)) { $previos = $collectuids; $collectuids = array_merge($previos, $list); } ++$page; usleep(335000); } while($countcomm > $offset + $limit ); $uniqs = array_unique($collectuids); $ridding = fopen('service/glist.txt', 'r'); $unsr = fgets($ridding, 98765432); fclose($ridding); $last = unserialize($unsr); $different = array_diff($uniqs, $last); $ss = serialize($uniqs); $wrguids = fopen("service/glist.txt", "w+b"); fwrite($wrguids,$ss); fclose($wrguids); $ss = serialize($different); $wrguids = fopen("service/diferent.txt", "w+b"); fwrite($wrguids,$ss); fclose($wrguids); function vkapi($method) { $ch = curl_init("https://api.vk.com/method/".$method); 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; } ?>
Войдите для добавления комментария.
Нет комментариев
Яндекс.Метрика Яндекс.Метрика