Advertisement
shor7cut

API FACEBOOK : mengambil daftar groups user mengunakan API

Aug 24th, 2015
485
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <pre>
  2. <?php
  3. // shor7cut - BUG6SEC http://facebook.com/bug7sec
  4. error_reporting(0);
  5. $acces_token = "CAACEdEose0cBACjUYfel2cXhXVtwZAsNXxntDWw4r9Os5ZAwmTG0VassEvsQeoWqxDg7qXL3HWPgxZBKIfP2a6umVCxmYas1uyBiFZCjxcBq4IcB417IVrJhSNILF2cdHvevfpFXGr0boqIWVlUJy8ZB7s0xedMgq2A9wPj332eC2gKnkTiRPP8ZD";
  6. $url_exp = file_get_contents("https://graph.facebook.com/v2.2/me?fields=groups{id,name,owner},accounts&access_token={$acces_token}");
  7. $json_url_exp = json_decode($url_exp,TRUE);
  8. if($json_url_exp){
  9.     $url = file_get_contents("https://graph.facebook.com/v2.2/me?fields=groups{id,name,owner},accounts&access_token={$acces_token}");
  10.     $json_url = json_decode($url,TRUE);
  11. foreach ($json_url['groups']['data'] as $key => $data_groups) {
  12.     echo 'Nama Groups : <a href="https://www.facebook.com/groups/'.$data_groups['id'].'">'.$data_groups['name'].'</a><br>';
  13.     echo 'Pemilik Groups : '.$data_groups['owner']['name']."<br><br>";
  14. }
  15. }else {
  16.     echo "Ops... Mungkin akses token sudah 'expire' atau mungkin juga karena kesalahanan akses token yang kurang tepat.";
  17. }
  18. /*
  19.  
  20. */
  21. ?>
Advertisement
RAW Paste Data Copied
Advertisement