in PHP

Get Twitter Followers From Twitter XML

As of March 5th 2013 this technique will not work anymore as this uses the old Twitter API, to learn how to use the new Twitter API have a look at this tutorial. [Using The New Twitter API V1.1]( "Using The New Twitter API V1.1")
## Twitter XML Use the twitter to access your account or any account and return the number of followers you have. Many websites like to do this so that they can show how popular they are on Twitter hoping this will encourage more people to follow them. Below is a small PHP snippet which will access a piece of XML for your account and grab your followers count so you can display this on your website. As this snippet is getting XML about your profile it will also return lots more data which you can use the same approach to get certain data from the XML. ``` function get_followers($twitter_id){ $xml=file_get_contents(''.$twitter_id); if (preg_match('/followers_count>(.*)

Upgrade to access all content on Paulund

Members unlock all tutorials and snippets

Access to all downloadable content

Access to code examples before others

Sign Up Now

Already a member? Login here

Subscribe To The Weekly Newsletter

Get weekly updates to your email