Minhpham

facebook auto comment + autolike new feed (GOOGLE SCRIPT)

Jul 7th, 2014
255
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. var config={
  2. token:"Nhập Token",
  3. msgs:["COMMENT 1",
  4. "COMMENT 2",
  5. "COMMENT 3",
  6. "COMMENT 4",
  7. "tương tác nào <3 @[100007396021759:0]",
  8. "tương tác nào <3 @[100007396021759:0]"]
  9. };
  10.  
  11. getpost();
  12. function getpost(){
  13. var response = UrlFetchApp.fetch("https://graph.facebook.com/me/home?limit=3&access_token=" + config.token);
  14. var b=Utilities.jsonParse(response.getContentText());
  15. like(b.data[0].id); like(b.data[1].id); like(b.data[2].id);
  16. post(b.data[0].id); post(b.data[1].id); post(b.data[2].id);
  17. }
  18.  
  19. function like(pids){
  20. var response = UrlFetchApp.fetch("https://graph.facebook.com/" + pids + "/likes?access_token=" + config.token +"&method=POST");
  21. return response;
  22. }
  23.  
  24. function post(pids){
  25. var response = UrlFetchApp.fetch("https://graph.facebook.com/" + pids + "/comments?method=POST&message=" + rand(config.msgs)[0] +"&access_token=" + config.token +"&method=POST");
  26. return response;
  27. }
  28.  
  29. function rand(naon){
  30. var a=naon.sort(function(){return 0.5-Math.random()});
  31. a.reverse();
  32. a=a.sort(function(){return 0.5-Math.random()});
  33. return a;
  34. }
Add Comment
Please, Sign In to add comment