/ Published in: PHP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
/** * Fetch the number of followers from twitter api * * @author Peter Ivanov * @copyright http://www.ooyes.net * @version 0.2 * @link http://www.ooyes.net * @param string $username * @return string */ function twitter_followers_counter($username) { } else { } $api_call = $cache_file_time; $difference = $now - $api_call; $api_time_seconds = 1800; if ($difference >= $api_time_seconds) { $api_page = 'http://twitter.com/users/show/' . $username; $profile = new SimpleXMLElement ( $xml ); $count = $profile->followers_count; } } else { } }