Monthly Archives: December 2009

RSS to CSV Converter

Recently @tonyadam was asking about for a way to import Twitter search results into Excel via RSS or CSV. I couldn’t find a suitable method on my slightly out of date Excel 2003, but sent Tony a link explaining how Excel 2007 could get him closer to what he wants. Turns out he was on the Mac anyways, so we needed an alternative way.

Importing into Excel usual involves using the CSV format. So all we needed was an RSS to CSV format converter, but surprisingly couldn’t find anything relevant on the web. In general there isn’t much interest in XML to CSV conversion because it would only make sense for the simplest of XML files — basically, one table with rows & columns. Anything more complicated won’t fit within the confines of CSV.

To solve this problem, I created an RSS to CSV converter script, using a bit of YQL for the feed fetching and parsing.

We can test it using Tony’s original request — Twitter search results — as follows:

  1. Login to twitter
  2. Search for something (my sample: nascar)
  3. On the right-hand side, copy the “RSS feed for this query link”
  4. Go to RSS to CSV converter
  5. Paste in Twitter RSS link, changing “.atom” to “.rss” (my sample: http://search.twitter.com/search.rss?q=nascar)
  6. Click Submit
  7. Save CSV file when prompted, or import into Excel

Update 2011-09-11: Twitter’s UI changes have removed the old links for search result RSS feeds, so the above steps won’t quite work. See this article from Learning LibTech for an alternative way to find the feeds directly. Also, the source code for this script is now on Github.

One problem I discovered (again) is that Excel is not happy with Unicode characters in CSV format. There are some alternatives described, so I may enhance this script to properly handle UTF-8 if someone has a use-case for it.

Private Browsing as a Developer Tool

Having spent the better part of today debugging a problem with cookies on a couple different servers, I stumbled on the fact that the “Private Browsing” feature of Firefox was exceptionally handy for my situation. Private browsing is usually touted as a feature for “porn browsing”, or other activities in which you’re trying to not leave a trail. The same cleanroom features make it ideal for testing and developing web applications.

In a typical case where you’d need to clear browser history, clear cookies, and so on, I would usually keep one browser set up with developer tools (bugs, twiki, etc.), and launch another browser to be the guinea pig. With private browsing, I can now use my preferred browser (Firefox) for both cases.