Twitter search via Ruby

Thanks to, I finally have a twitter search feed working.


The link shows how to generate a graph based on tweets, which maybe helpful later. What my requirement was is to show the most recent 10 tweets based on a few keywords. Here’s how I did it:


1. Don’t install the twitter gem. It’ll lead you down an oAuth rabbit hole that you don’t really need.

2. In your controller, create a twitter_search definition:

3. Also in your controller index, perform the twitter search:

4. In your view, create a table to display the results:


The CGI::unescapeHTML gets rid of the nasty &lt marks. The auto_link detects http[s]://—- strings and makes them an html link. 

Next step is to make it auto-update.

Leave a Reply

Powered by

Up ↑

%d bloggers like this: