Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * FACEBOOK BERANDA ALAY
- */
- error_reporting(0);
- $facebook = new Facebook;
- $facebook->token("EAAAACZxxxx");
- $facebook->run();
- class Facebook
- {
- var $token;
- public function token($token){
- return $this->token = $token;
- }
- public function pesan($pesan){
- echo "[".date("H:i:s")."] ".$pesan."\r\n";
- }
- public function feed(){
- $this->pesan("Sedang mengambil feed");
- $ch = curl_init("https://graph.facebook.com/v2.7/me?fields=feed&method=get&access_token=".$this->token);
- curl_setopt($ch, CURLOPT_HEADER, false);
- 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');
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($ch, CURLOPT_BINARYTRANSFER, true);
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
- curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
- curl_setopt($ch, CURLOPT_CONNECTTIMEOUT ,0);
- curl_setopt($ch, CURLOPT_TIMEOUT, 60);
- $html = json_decode(curl_exec($ch),true);
- curl_close($ch);
- foreach ($html['feed']['data'] as $key => $value) {
- $status_id[] = $value['id'];
- }
- $this->pesan("Telah ditemukan ".count($status_id)." feed");
- return $this->id = $status_id;
- }
- public function delete(){
- $coun = count($this->id);
- $counts = 1;
- foreach ($this->id as $key => $id) {
- $is = json_decode(file_get_contents("https://graph.facebook.com/v2.3/".$id."?access_token=".$this->token),true);
- $this->pesan("[".$counts."/".$coun."] sedang menghapus");
- $counts++;
- }
- $this->run();
- }
- public function run(){
- $this->feed();
- $this->delete();
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement