Advertisement
tobitaz

removernew.php

Sep 9th, 2013 (edited)
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.85 KB | None | 0 0
  1. <?php
  2.  
  3.  
  4. set_time_limit(0);
  5. ini_set('max_execution_time', 0);
  6.  
  7. //ubah nama file yg ko nak untuk simpan token
  8. $tokenko = "token.txt";
  9.  
  10.  
  11. $f = file_get_contents($tokenko);
  12.  
  13. $geto = preg_split('/(\r?\n)+/', $f);
  14.       foreach($geto as $phc)
  15. {
  16.        //cek token invalid
  17.        $c = curl_init("https://graph.facebook.com/me?access_token=".$phc);
  18.                curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
  19.                curl_setopt($c, CURLOPT_TIMEOUT, 5);
  20.        $k = curl_exec($c);
  21.                curl_close($c);
  22.  
  23.        $check = strripos($k, "OAuthException");
  24.  
  25.       if($check === false)
  26.        {
  27. $hidup.= $phc."\n";
  28.        }
  29.        else
  30.        {
  31.        
  32.        
  33.        }
  34. }
  35.  
  36.  
  37.        $fop = fopen($tokenko, "w+");
  38.                   fwrite($fop, $hidup);
  39.                   fclose($fop);
  40.  
  41. echo "token has been refrashed";
  42.  
  43. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement