Advertisement
bug7sec

FACEBOOK BERANDA ALAY (HAPUS KAN)

Aug 5th, 2016
823
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.62 KB | None | 0 0
  1. <?php
  2. /**
  3. * FACEBOOK BERANDA ALAY
  4. */
  5. error_reporting(0);
  6. $facebook = new Facebook;
  7. $facebook->token("EAAAACZxxxx");
  8. $facebook->run();
  9.  
  10. class Facebook
  11. {
  12.     var $token;
  13.     public function token($token){
  14.         return $this->token = $token;
  15.     }
  16.     public function pesan($pesan){
  17.         echo "[".date("H:i:s")."] ".$pesan."\r\n";
  18.     }
  19.     public function feed(){
  20.         $this->pesan("Sedang mengambil feed");
  21.         $ch = curl_init("https://graph.facebook.com/v2.7/me?fields=feed&method=get&access_token=".$this->token);
  22.         curl_setopt($ch, CURLOPT_HEADER, false);
  23.         curl_setopt($ch, CURLOPT_USERAGENT,'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13');
  24.         curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  25.         curl_setopt($ch, CURLOPT_BINARYTRANSFER, true);
  26.         curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
  27.         curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
  28.         curl_setopt($ch, CURLOPT_CONNECTTIMEOUT ,0);
  29.         curl_setopt($ch, CURLOPT_TIMEOUT, 60);
  30.         $html = json_decode(curl_exec($ch),true);
  31.         curl_close($ch);
  32.         foreach ($html['feed']['data'] as $key => $value) {
  33.             $status_id[] = $value['id'];
  34.         }
  35.         $this->pesan("Telah ditemukan ".count($status_id)." feed");
  36.         return $this->id = $status_id;
  37.     }
  38.  
  39.     public function delete(){
  40.         $coun   = count($this->id);
  41.         $counts = 1;
  42.         foreach ($this->id as $key => $id) {
  43.              $is = json_decode(file_get_contents("https://graph.facebook.com/v2.3/".$id."?access_token=".$this->token),true);
  44.              $this->pesan("[".$counts."/".$coun."] sedang menghapus");
  45.              $counts++;
  46.         }
  47.         $this->run();
  48.     }
  49.  
  50.     public function run(){
  51.         $this->feed();
  52.         $this->delete();
  53.     }
  54.    
  55.  
  56. }
  57. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement