Advertisement
AbdulMuttaqin

[PHP] Auto Post Grup

Sep 23rd, 2017
372
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.74 KB | None | 0 0
  1. #Abdul Muttaqin
  2. #523 Cyber Art
  3.  
  4. <?php
  5. $access_token= "TOKENKAMU";
  6.  
  7. $me = json_decode(auto('https://graph.facebook.com/me?access_token='.$access_token.'&fields=id'),true);
  8. $dg = json_decode(auto('https://graph.facebook.com/me/groups?access_token='.$access_token.'&method=GET&limit=50'),true);
  9.  
  10. $message= ("Hay :v");
  11.  
  12. for($i=1;$i<=count($dg[data]);$i++){
  13. if(!ereg($dg[data][$i-1][id])){
  14. echo auto('https://graph.facebook.com/'.$dg[data][$i-1][id].'/feed?message='.urlencode($message).'&access_token='.$access_token.'&method=post').'<hr/>';
  15.    }
  16. }
  17.  
  18.  
  19. function auto($url){
  20.    $ch=curl_init();
  21.    curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
  22.    curl_setopt($ch,CURLOPT_URL,$url);
  23.    $cx=curl_exec($ch);
  24.   curl_close($ch);
  25.   return($cx);
  26.   }
  27. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement