One of the things that people often ask me to add to TwitRSS.me is support for generating an RSS feed from a Twitter search. In fact some of the code that I originally used to build it was targetted at achieving exactly that objective.
I am now working 90% time at my day job, so I had a rare afternoon off this week to look at the problem. I've now got a working beta of the code.
I started by refactoring my original TwitRSS code and pulling what I could into a package, fittingly called TwitRSS.pm. That turns out to have been a good choice, because it means that I will be able to replace my original twitter_user_to_rss.pl script with a dramatically simpler implementation as well as making the new part of twitrss.me, twitter_search_to_rss.pl. Much of the code is identical, so it makes sense to share it.
All the code does is to grab the live search results page from Twitter, parse it using the same XPath expressions as I use for the user RSS and display it to the user.
I’ve done enough testing to be happy that it works for me
. If you fancy helping to test it here is a form, let me know what you think in the comments…