KinekaruFounder

Script Bot Reactiom Access Token FB

Oct 6th, 2018
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. <?php
  2. $token = "EAAAAAYsX7...ZDZD"; // isi dengan access_token anda
  3. $type = "LIKE"; // silahkan pilih salah satu => LIKE, LOVE, WOW, HAHA, SAD, ANGRY, PRIDE
  4. $brp = 5; // jumlah status
  5.  
  6. function curl($url, $post = null) {
  7. $ch = curl_init();
  8. curl_setopt($ch, CURLOPT_URL, $url);
  9. if ($post != null) {
  10. curl_setopt($ch, CURLOPT_POST, true);
  11. curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
  12. }
  13. curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
  14. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  15. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
  16. $exec = curl_exec($ch);
  17. curl_close($ch);
  18. return $exec;
  19. }
  20.  
  21. $ambil = json_decode(curl("https://graph.facebook.com/me/home?access_token=".$token."&fields=id&limit=".$brp))->data;
  22. foreach ($ambil as $data) {
  23. $send = json_decode(curl("https://graph.facebook.com/".$data->id."/reactions", array(
  24. "type" => $type,
  25. "access_token" => $token,
  26. "method" => "POST"
  27. )
  28. ));
  29. if ($send->success)
  30. echo $data->id." <font color=green>Success</font><br /><hr>";
  31. else
  32. echo $data->id." <font color=red>Error</font><br /><hr>";
  33. }
  34.  
  35. ?>
Add Comment
Please, Sign In to add comment