Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 8th, 2012  |  syntax: None  |  size: 0.62 KB  |  hits: 12  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <?php
  2. /*
  3. *
  4. * As found at: http://dev.firsttube.com/fans-followers.php
  5. *
  6. */
  7.  
  8. $fb_username = 'phishnet';
  9. $tw_username = 'phishnet';
  10.  
  11. $fb = @json_decode(file_get_contents('https://graph.facebook.com/'.$fb_username));
  12. $fb_fans = number_format($fb->likes);
  13.  
  14. $tw =  @json_decode(file_get_contents('http://api.twitter.com/1/users/show.json?screen_name='.$tw_username));
  15. $tw_followers = number_format($tw->followers_count);
  16. ?><html>
  17.     <head>
  18.         <title>Fans and Followers</title>
  19.     </head>
  20.     <body>
  21.         Facebook fan count: <?=$fb_fans;?><br />
  22.         Twitter follower count: <?=$tw_followers;?><br />
  23.     </body>
  24. </html>