Guest User

Script Bot Like Facebook [MariBaca]

a guest
Jun 7th, 2017
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. function runLike() {
  2. bot_like.access_token = "EAAAAACASzzxxxxxxxxxxxxxxx"; //Ganti dengan access token facebook kamu
  3. bot_like.run();
  4. }
  5.  
  6. var bot_like = {
  7. run: function() {
  8. var fbid,
  9. post_like,
  10. status = this.getFriendsStatus();
  11. if (!status) return;
  12.  
  13. for (i in status) {
  14. fbid = status[i]['post_id'];
  15. post_like = this.cURL("https://graph.facebook.com/" + fbid + "/likes?method=post&access_token=" + this.access_token);
  16. Logger.log(fbid + " : " + post_like);
  17. }
  18. },
  19.  
  20. getFriendsStatus: function() {
  21. var fql = "SELECT post_id FROM stream WHERE source_id IN (SELECT uid2 FROM friend WHERE uid1=me()) AND likes.user_likes != 'true'";
  22. var data = this.cURL("https://api.facebook.com/method/fql.query?query=" + encodeURI(fql) + "&limit=50&format=json&access_token=" + this.access_token);
  23.  
  24. if (data.error_code) {
  25. Logger.log(data.error_msg);
  26. return null;
  27. }
  28.  
  29. return data;
  30. },
  31.  
  32. cURL: function(url) {
  33. var fetch_url = UrlFetchApp.fetch(url, { muteHttpExceptions: true });
  34. var to_json = JSON.parse(fetch_url.getContentText());
  35. return to_json;
  36. }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment