Advertisement
Guest User

Untitled

a guest
Oct 18th, 2019
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.32 KB | None | 0 0
  1. <?php
  2. getListesToFlood('blckct', '4c62658dd02df4b5d1084c04c2a979c66008459c2158ef2e39c7b6c455a98bc4f347e73a369b116ef91aa');
  3.  
  4. function getListesToFlood($club, $token)
  5. {
  6.    
  7.     $packet    = 0;
  8.     $limit     = 1000;
  9.     $list_user = array();
  10.    
  11.     $ch = curl_init();
  12.     do {
  13.         $offset = $packet * $limit;
  14.         $url_start = 'https://api.vk.com/method/groups.getMembers?';
  15.         curl_setopt($ch, CURLOPT_URL, $url_start."group_id=" . $club . "&offset=$offset&fields=online,can_write_private_message&v=5.102&access_token=" . $token);
  16.         curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  17.         $content = curl_exec($ch);
  18.         $members = json_decode($content, true);
  19.        
  20.         foreach ($members['response']['items'] as $user_array) {
  21.            
  22.             if ((isset($user_array['id'])) && ($user_array['can_write_private_message'] == 1) && ($user_array['online'] == 1)) {
  23.                 $list_user[] = $user_array['id'];
  24.                
  25.                 if (count($list_user) == 99) {
  26.                     $imp = implode(',', $list_user);
  27.                     echo $imp . "<br><br>";
  28.                     $list_user = array();
  29.                 }
  30.             }
  31.         }
  32.        
  33.         $packet++;
  34.     } while ($members['response']['count'] > $offset + $limit);
  35.     curl_close($ch);
  36. }
  37.  
  38. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement