-
-
Save 0xnbk/576893 to your computer and use it in GitHub Desktop.
Get the number of twitter follower in full text (PHP)
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
<?php | |
$xml=file_get_contents('http://twitter.com/users/show.xml?screen_name=catswhocode'); | |
if (preg_match('/followers_count>(.*)</',$xml,$match)!=0) { | |
$tw['count'] = $match[1]; | |
} | |
echo $tw['count']; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Get the number of twitter follower in full text (PHP)
When you have a website or blog and use Twitter, it can be cool to display how many followers you have. To do so, simply use the short code snippet above.
Note that if you want to integrate the same code into WordPress, using caching, Rarst have written a nice code that you can get using the link after the snippets (Rarst code is in the comments, so scroll down a bit)