Advertisement
getdowntonight

listelikes

Sep 16th, 2013
1,024
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.57 KB | None | 0 0
  1. <?php
  2. require("fb/facebook.php");
  3.  
  4. # Creating the facebook object
  5. $facebook = new Facebook(array(
  6. 'appId' => '***************', // APP ID
  7. 'secret' => '********************************', // TOKEN
  8. 'cookie' => true
  9. ));
  10. # Let's see if we have an active session
  11. $session = $facebook->getUser();
  12.  
  13. $post = $facebook->api('/510250905727300/likes?limit=1000');
  14. $post2 = $facebook->api('510250905727300/likes?limit=1000&after=MTY1MzMzMzE4Nw%3D%3D');
  15. $firstcount = count($post['data']);
  16. $secondcount = count($post2['data']);
  17. $realcount = $firstcount + $secondcount;
  18. ?>
  19. <!DOCTYPE HTML>
  20. <html lang="fr">
  21. <head>
  22. <meta charset="UTF-8"/>
  23. </head>
  24. <body>
  25. <p>Liste des likes (du + récent au + ancien) du <a href="https://www.facebook.com/soutienaubijoutierdenice/posts/510250905727300" target="_blank">premier post</a> de la page Soutien au bijoutier de Nice</p>
  26. <?php
  27. $x = 0;
  28. while($post['data'][$x]){
  29. ?>
  30. <p><?php echo $realcount;?> - <img src="http://graph.facebook.com/<?php echo $post['data'][$x]['id'];?>/picture">
  31. <a href="http://www.facebook.com/profile.php?id=<?php echo $post['data'][$x]['id'];?>" target="_blank"><?php echo $post['data'][$x]['name'];?>
  32. </a>
  33. </p>
  34. <?php
  35. $x++;
  36. $realcount--;
  37. }
  38. $i = 0;
  39. while($post2['data'][$i]){
  40. ?>
  41. <p><?php echo $realcount;?> - <img src="http://graph.facebook.com/<?php echo $post2['data'][$i]['id'];?>/picture">
  42. <a href="http://www.facebook.com/profile.php?id=<?php echo $post2['data'][$i]['id'];?>" target="_blank"><?php echo $post2['data'][$i]['name'];?></a>
  43. </p>
  44. <?php
  45. $i++;
  46. $realcount--;
  47. }
  48. ?>
  49. </body>
  50. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement