Advertisement
shutdown57

Auto Delete Post Facebook

Nov 3rd, 2018
773
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.72 KB | None | 0 0
  1. <?php
  2.  
  3. // coded by shutdown57
  4.  
  5. error_reporting(0);
  6. Class DeleterFB{
  7.     public $token;
  8.     public function kentu($url, $fields = null, $cookie = null) {
  9.         $ch = curl_init();
  10.         curl_setopt($ch, CURLOPT_URL, $url);
  11.         curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
  12.         curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
  13.         curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  14.         if($fields !== null) {
  15.             curl_setopt($ch, CURLOPT_POST, 1);
  16.             curl_setopt($ch, CURLOPT_POSTFIELDS, $fields);
  17.         }  
  18.         curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5000);
  19.         $response = curl_exec($ch);
  20.         curl_close($ch);
  21.         return $response;
  22.     }
  23.  
  24.     public function getToken()
  25.     {
  26.         echo "Paste Access Token :: "; $token=trim(fgets(STDIN));
  27.  
  28.         return $token;
  29.     }
  30.     public function grabData($token)
  31.     {
  32.         $data = $this->kentu('https://graph.facebook.com/me/posts?access_token='.$token.'&limit=1000&fields=id,name');
  33.         return json_decode($data);
  34.     }
  35.  
  36.     public function delete_run()
  37.     {
  38.         $token = $this->getToken();
  39.         $jem = $this->grabData($token);
  40.         $num=1;
  41.         foreach($jem->data as $but) {
  42.         $re = $this->kentu("https://graph.facebook.com/".$but->id."/?method=delete", "access_token=$token");
  43.      if($re == true || $re == 1) {
  44.         echo "[".$num++."] POSTINGAN ALAY TERHAPUS :V | POST ID: ".$but->id;
  45.         if(@$but->name!="" || !empty($but->name))
  46.         {
  47.             echo " [".$but->name."] \n";
  48.         }else{
  49.             echo "\n";
  50.         }
  51.     } else {
  52.         echo "[".$num++."] GAGAL MENGHAPUS POSTINGAN : ".$but->id."  ".$cu." \n";
  53.      }
  54.    
  55.     }
  56.  
  57.     }
  58. }
  59.  
  60. $s57 = new DeleterFB();
  61.  
  62. $s57->delete_run();
  63.  
  64. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement