I have created a function, which get twitter count using json.
But, I want to recheck it agian after some time, like an hour. But currently it checks every time when a page loads. and which effect page loading time.
there is already a PHP function which do exactly what i want, but I cant remember it, I just remember that the function start from tr....
Here is my function, which check twitter follower :
function follower( $tw ) {
$tw = @json_decode(file_get_contents('http://api.twitter.com/1/users/show.json?screen_name='.$tw));
$tw_followers = number_format($tw->followers_count);
return $tw_followers;
}
EDIT:
I found that PHP function:
set_transient('follower', $tw_followers, 60*60*24);
please guide me if I am wrong