Advertisement
Guest User

Untitled

a guest
Aug 11th, 2018
2,048
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.02 KB | None | 0 0
  1. <?php
  2.  
  3. $content = file_get_contents(__DIR__.'/accounts');
  4. $accounts = explode("\n", $content);
  5. $accounts = array_filter(array_unique($accounts));
  6. if(empty($accounts)){
  7.     echo("Add accounts to file  'accounts', each in a new line.\n");
  8. }
  9.  
  10.  
  11. foreach($accounts as $account){
  12.     if(check($account)){
  13.         echo "$account - OK!\n";
  14.     }else{
  15.         echo "$account - ERR!\n";  
  16.     }
  17.     //sleep(1); // in seconds
  18. }
  19.  
  20. function check($username){
  21.     $url = "https://www.instagram.com/{$username}/";
  22.     $ch = curl_init($url);
  23.     curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  24.     curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
  25.     //curl_setopt($ch, CURLOPT_HEADER, true);
  26.     //curl_setopt($ch, CURLOPT_NOBODY, true);
  27.     curl_setopt($ch,CURLOPT_USERAGENT,'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36');
  28.     $c = curl_exec($ch);
  29.     //print_r(curl_getinfo($ch));
  30.     //print_r($c);
  31.     if(curl_getinfo($ch, CURLINFO_HTTP_CODE) === 404){
  32.         return true;
  33.     }
  34.     return false;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement