TikusPintar

Bot Reactions ( Google Script )

Jun 25th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var aing={
  2.   getApi:function(huh){var a=UrlFetchApp.fetch(huh,{muteHttpExceptions:true,method:"get",validateHttpsCertificates:false}),b=JSON.parse(a.getContentText());return b},
  3.   setApi:function(huh,pl){var a=UrlFetchApp.fetch(huh,{muteHttpExceptions:true,method:"post",payload:pl,validateHttpsCertificates:false}),b=JSON.parse(a.getContentText());return b}
  4. };
  5.  
  6. function reaction(){
  7.   var token="EAA..DXD"; //Your Token IPhone
  8.   var tipe="WOW"; //LIKE, LOVE, WOW, HAHA, SAD, ANGRY, THANKFUL < Take One
  9.   var limit="5";
  10.   var ambil=aing.getApi("https://graph.beta.beta.beta.facebook.com/me/home?access_token="+token+"&fields=id&limit="+limit);
  11.   for(var i in ambil.data){
  12.     var react=aing.setApi("https://graph.beta.beta.facebook.co.id/"+ambil.data[i].id+"/reactions",{access_token:token,method:"post",type:tipe});
  13.     if(react.success){ // CTRL + ENTER to see Log
  14.       Logger.log(ambil.data[i].id+":success");
  15.     }else{
  16.       Logger.log(ambil.data[i].id+":error");
  17.     }
  18.   }
  19. }
Add Comment
Please, Sign In to add comment