Advertisement
shor7cut

Facebook Auto Like Beranda (CLI Mode)

Oct 21st, 2015
6,708
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.60 KB | None | 0 0
  1. <?php
  2. error_reporting(0);
  3. scan();
  4. function scan(){
  5. $token = "akses toket";
  6. $limit = "5";
  7. $ambil_konten = file_get_contents("https://graph.facebook.com/v2.1/me/home?fields=id,from,type,message&limit={$limit}&access_token={$token}");
  8. $jdecode = json_decode($ambil_konten,true);
  9. //print_r($jdecode);
  10. foreach ($jdecode['data'] as $key => $data) {
  11.     $data_id = $data['id']; // data id
  12.     $data_name = $data['from']['name']; // pemilik status
  13.     $data_time = $data['created_time']; // waktu status
  14.     $data_pesan = $data['message'];
  15. /* mulai like */
  16.     $url = "https://graph.facebook.com/v2.1/{$data_id}/likes";
  17.     $curl = curl_init();
  18.     curl_setopt($curl, CURLOPT_URL, $url);
  19.     curl_setopt($curl, CURLOPT_CONNECTTIMEOUT,20);
  20.     curl_setopt($curl, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.64 Safari/537.31');
  21.     curl_setopt($curl, CURLOPT_COOKIE,'cookie.txt');
  22.     curl_setopt($curl, CURLOPT_COOKIEFILE,'cookie.txt');
  23.     curl_setopt($curl, CURLOPT_COOKIEJAR,'cookie.txt');
  24.     curl_setopt($curl, CURLOPT_POSTFIELDS,"access_token={$token}&method=post");
  25.     curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 3);
  26.     curl_setopt($curl, CURLOPT_HEADER, 0);
  27.     curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
  28.     curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
  29.     curl_setopt($curl,CURLOPT_FOLLOWLOCATION,true);
  30.     $result = curl_exec($curl);
  31.     $results = json_decode($result,true);
  32.     curl_close($curl);
  33.     if($results['success']){
  34.         echo "[Success]-> ".substr_replace($data_pesan,"...",16)." - ".$data_name."\r\n";
  35.     }
  36. }
  37.     scan();
  38. }
  39. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement