Collecting Twitter stats using a Twitter Bot

I have been playing with the Bot to get some information out of Twitter, the main problem the restriction of 100 requests per hour, means that could take a few hours to get the information of a user with lots of followers. I used Robert Scoble and Scott Hanselman for the test.

Total Network: the number of followers and one level in the followers of those.

Follower used in December: The followers that sent an update on the month of December.

Not used in December: The followers that didn’t use Twitter on the month of December

Total: Total Followers

% of followers Active: The percentage of followers that still use Twitter.

 

Total Network

Followers used in December Not used in December Not used at all Total % of Followers Active
scobleizer 13453840 34161 8961 3195 46317 73.75
shanselman 1377178 4161 1068 471 5700 73.00
alpascual 557335 346 19 4 369 93.77

I got the highest percentage of people following me, well I am also newer at Twitter, I guess is telling us that almost 30% of the users do not use Twitter any more, better than the 80% I said before, the bot was going crazy that day ;-)

The code to get the info can be found here:

                ArrayList UsersToFollowTemp = new ArrayList();

                string sXml = "";
                bool Success = false;
                do
                {
                    try
                    {
                        sXml = twitter.Followers(MyUsername, Mypassword, sUser, i);
                        Success = true;

                    }
                    catch
                    {
                        Thread.Sleep((1000 * 60)* 20);
                        Success = false;
                    }
                } while (Success == false);

                XDocument loaded = XDocument.Parse(sXml);


                var allElements = from stat in loaded.Descendants("user")
                                  select new
                                  {
                                      ID = stat.Element("id").Value,
                                      Name = stat.Element("name").Value,
                                      Status = stat.Element("status"),
                                      FollowersCount = stat.Element("followers_count").Value,
                                  };

                foreach (var allNames in allElements)
                {                    
            // Do your process with the data you collected

Related posts

How to make a post request to Twitter in C# to add people to follow

Guy Kawasaki reveals great ideas yet is against twitter!

Cheers

Al

Follow me in twitter | bookmark me | Subscribe to my feed | Check out GeoTwitter | Create GeoRss content

Published Tuesday, December 30, 2008 11:53 PM by albertpascual

Comments

No Comments

Leave a Comment

(required) 
(required) 
(optional)
(required)