Advertisement
talama

HƯỚNG DẪN CÀI ĐẶT BOT LIKE

Jun 19th, 2017
297
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 KB | None | 0 0
  1. <?php
  2. header('Content-Type: text/html; charset=utf-8');
  3. $token = ['',
  4. '',
  5. '',
  6. ''];
  7. for($j =0;$j<count($token); $j++){
  8. $ids = json_decode(file_get_contents("https://graph.facebook.com/me/home?fields=id&limit=3&access_token=".$token[$j]));
  9. foreach($ids->data as $values){
  10. $id = $values->id;
  11. $file = fopen("noidung.txt", "r");
  12. $members = array("noi dung");
  13. $x= rand(0, count($members)-1);
  14. echo 'dang cmt cho bai viet ',$id,' noi dung ',$members[$x],PHP_EOL;
  15. if($id)
  16. {
  17. $post = [
  18. 'message' => $members[$x],
  19. 'access_token' => $token[$j],
  20. ];
  21.  
  22. $url = 'https://graph.facebook.com/'.$id.'/comments';
  23. $ch = curl_init();
  24. curl_setopt_array($ch, array(
  25. CURLOPT_URL => $url,
  26. CURLOPT_POSTFIELDS => $post,
  27. CURLOPT_RETURNTRANSFER => true,
  28. CURLOPT_SSL_VERIFYPEER => false,
  29. CURLOPT_VERBOSE => true
  30. ));
  31. $result = curl_exec($ch);
  32. file_get_contents("https://graph.facebook.com/".$id."/likes?method=post&access_token=".$token[$j]);
  33. }
  34. }
  35. }
  36.  
  37. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement