I am using the following php code to display Facebook Fans. Was hoping to do something similar for Twitter.
Any help Appreciated.
<?php
function fbfan() {
$pageID = 'facebookID';
$info = json_decode(file_get_contents('http://graph.facebook.com/' . $pageID));
echo $info->likes;
}
?>
Using :
<p><?php fbfan(); ?> Facebook Fans</p>
The above works great meaning we can style to our hearts content, plus its lightweight.
Is there anything remotely similar for Twitter ? To echo number of followers.
Just use the twitter json file like you are with the facebook API
Beware though that you should cache the json file as twitter limits you to something like 60/hour