Created
January 26, 2012 21:22
-
-
Save edwardteach42/1685193 to your computer and use it in GitHub Desktop.
Get Number of Followers on Twitter
This file contains hidden or 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
/** | |
* Get Number of Twitter Followers | |
* | |
* LICENSE: distributions of the source code without | |
* authors permission is forbidden, For written | |
* permission please contact [email protected]. | |
* | |
* Can also use the following to pull with $getData: | |
* id | |
* name | |
* screen_name | |
* location | |
* description | |
* profile_image_url | |
* url | |
* friends_count | |
* created_at | |
* lang | |
*/ | |
$screenName = ''; | |
$getData = 'followers_count'; | |
$xml = file_get_contents('http://twitter.com/users/show.xml?screen_name=' . $screenName); | |
if(preg_match('/' . $getData . '>(.*)</', $xml, $match) !=0) | |
echo $match[1]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment