Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Счетчик Twitter с кэшированием
- function nlt_getTwitterCounter($userID='androidbar') {
- $output = get_transient('twitter_counter');
- if ( $output === false || $output == '' ) {
- $data = json_decode(@file_get_contents('http://api.twitter.com/users/' . $userID .'.json'));
- $output = $data->followers_count;
- set_transient( 'twitter_counter', $output, 60*10 );
- }
- echo $output;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement