05.08.2013 14:45
'> $interval = 3600; if($_SERVER['REQUEST_TIME'] > get_option('pyre_twitter_cache_time')) { @$api = wp_remote_get('http://api.twitter.com/1/statuses/user_timeline.json?screen_name='.get_option('pyre_twitter_id')); @$json = json_decode($api['body']); if(@$api['headers']['x-ratelimit-remaining'] >= 1) { update_option('pyre_twitter_cache_time', $_SERVER['REQUEST_TIME'] + $interval); update_option('pyre_twitter_followers', $json[0]->user->followers_count); } } ?>