Charlie Harvey

TwitRSS.me: Get an RSS feed of a Twitter search

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…


Comments

  • Be respectful. You may want to read the comment guidelines before posting.
  • You can use Markdown syntax to format your comments. You can only use level 5 and 6 headings.
  • You can add class="your language" to code blocks to help highlight.js highlight them correctly.

Privacy note: This form will forward your IP address, user agent and referrer to the Akismet, StopForumSpam and Botscout spam filtering services. I don’t log these details. Those services will. I do log everything you type into the form. Full privacy statement.