Automating collection of Twitter user stats

Posted on July 7, 2011

Nasty little hack, but it works.

  1. Download Curl
  2. Download the OpenSLL DLL’s
  3. Create your text file with the list of Twitter accounts you want, one line per account (twits.txt)
  4. Create your batch file in the same folder as the above 3, just the following 2 lines needed (doit.bat)
    1. DEL out.xml
    2. FOR /F %%i IN (twits.txt) do (curl http://twitter.com/users/show.xml?screen_name=%%i >>out.xml & ping -n 2 -w 1 127.0.0.1>NUL)
  5. Run the batch file, it creates “out.xml”
  6. Load the XML file into notepad/wordpad
  7. Search and replace to remove the following <?xml version=”1.0″ encoding=”UTF-8″?>
  8. Except for the first line which must remain
  9. Then add in <twits> as the second line in the file and </twits> as the last line of the file
  10. Now save the XML file
  11. Load it into Excel.
  12. All done, enjoy

Tags: , , , ,

Categories: Research, Social Media


Leave a Reply

%d bloggers like this: