Blog Archives
Google Buzz Followers
// <![CDATA[javascript" charset="utf-8">]]>
function f(result) {
document.getElementById('count').textContent =
result.data.totalResults;
}
</script>
// <![CDATA[src="]]>https://www.googleapis.com/buzz/v1/people/Your_userID/@groups/@followers?max-results=0&alt=json&callback=f"></script>+ Followers</span>
you have to create profile under the url http://www.google.com/profiles
then give the google user Id in the link inside script
Twitter Followers Count
php
function tcount( $username, $field, $display = false ) {
$interval = 3600;
$cache = get_option('tcount');
$url = 'http://api.twitter.com/1/users/show.json?screen_name='.urlencode($username);
if ( false == $cache )
$cache = array();
if ( !isset( $cache[$username][$field] ) ) {
$cache[$username][$field] = NULL;
$cache[$username]['lastcheck'] = 0;
}
if( $cache[$username]['lastcheck'] $value)
if( isset($data->$key) )
$cache[$username][$key] = $data->$key;
$cache[$username]['lastcheck'] = time();
}
else {
$cache[$username]['lastcheck'] = time()+60;
}
update_option( 'tcount , $cache );
}
if ( false != $display )
echo $cache[$username][$field];
return $cache[$username][$field];
}
?>
To Display Twitter Count Use Code Below
echo tcount(“Your_twitter_user_name”,”followers_count”);
Face Book Fan Count
Have to download facebook.php file into theme folder.
Get file from following url http://github.com/facebook/php-sdk/raw/master/src/facebook.php
<?php
require_once('facebook.php');
$facebook = new Facebook(array(
'155396374496007',
'secret' => '33a5523fa4fdeecb2e5c29d55afc9627',
'cookie' => true,
));
$result = $facebook->api(array(
'method' => 'fql.query',
'query' => 'select fan_count from page where page_id = give_ur_page_ID_here;'
));
$fb_fans = $result[0]['fan_count'];
?>
To Display facebook fans Count Use Code Below
echo $fb_fans;