Is it possible to get the current total Twitter followers number? and how often?

Is it possible to get the current total Twitter followers number? and how often?,twitter,Twitter,Here is the thing. I'd like to set up a counter that shows total number of Twitter followers for a user. When the number of followers reach exactly 1,000,000, would love to do something. If there's an api to do that, how often can I call the api. Thanks.

Here is the thing. I'd like to set up a counter that shows total number of Twitter followers for a user. When the number of followers reach exactly 1,000,000, would love to do something. If there's an api to do that, how often can I call the api.

Thanks.


#1

Hello Sorry I don't know PHP that well, and not at all JQuery, however, here is what I've done in C# ... hope it helps ;)

// Launch the request to obtain the number of followers of the user
WebRequest request = HttpWebRequest.Create("http://twitter.com/users/show.xml?screen_name=[username]");

using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
{
StreamReader streamReader = new StreamReader(response.GetResponseStream());

// Load response in an XML Document
XmlDocument doc = new XmlDocument();
doc.LoadXml(streamReader.ReadToEnd());

// Parse the node we're interested in...
XmlNode node = doc.DocumentElement.SelectSingleNode("followers_count");

// ... and affect the number of followers
labelScore.Text = node.InnerText;
}

#2

Yes, you can use the users/show call to get this information. You'll find it as a property named followers_count:

"followers_count": 160752,

#3

Thanks, it's very helpful. I can use other properties as well to extract from the xmldoc.

#4

Awesome. How can I retrieve the followers_count property then? You have a simple example. Appreciated. Using jquery or php or whatever you like.