Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ```<?php
- header('Content-Type: text/html; charset=UTF-8');
- require_once __DIR__ . '/vendor/autoload.php';
- use VK\Client\VKApiClient;
- $token = 'e890fbff5353f7b3da8a94196707f8b368c3a5c9b7f176c7cb7c170c33d92d437c54ea0067b2e94fa90a9';
- $vk = new VKApiClient();
- $r = $vk->friends()->get($token);
- //$friend_ids = array_chunk($r['items'], 1000);
- $friend_ids =$r['items'];
- sleep(3);
- $users = [];
- $user_ids = [];
- $deleted = [];
- $banned = [];
- $too_much_friends = [];
- $i = 0;
- foreach ($friend_ids as $key => $id) {
- $i++;
- if($i == 50) {
- sleep(1);
- $i = 0;
- }
- $users = $vk->users()->get($token, ['user_ids' => $id, 'fields' => ['counters']]);
- foreach ($users as $key => $user) {
- if ($user['deactivated'] == 'deleted') {
- $deleted[] = $user;
- unset($users[$key]);
- continue;
- } elseif ($user['deactivated'] == 'banned') {
- $banned[] = $user;
- unset($users[$key]);
- continue;
- } elseif ($user['counters']['friends'] > 1499) {
- $too_much_friends[] = $user;
- unset($users[$key]);
- continue;
- }
- }
- }
- print "Удаленных юзеров: " . count($deleted) . "<br>";
- print "Забанненых юзеров: " . count($banned) . "<br>";
- print ">1500 юзеров: " . count($too_much_friends) . "<br>";```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement