Created
April 27, 2012 03:04
-
-
Save mebcomputers/2505346 to your computer and use it in GitHub Desktop.
php: get twiiter followers amount
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function get_followers($twitter_id){ | |
$xml=file_get_contents('http://twitter.com/users/show.xml?screen_name='.$twitter_id); | |
if (preg_match('/followers_count>(.*)</',$xml,$match)!=0) { | |
$tw['count'] = $match[1]; | |
} | |
return $tw['count']; | |
} | |
$nb = get_followers('phpsnippets'); | |
echo "PHP Snippets already have ".$nb." followers!"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment