how to consume twitter/datasift stream with rails on heroku

heroku, ruby-on-rails, ruby-on-rails-3, twitter

Solution

Your two options are to use a worker dyno to run a script that consumes the stream and writes it to a data store (your database etc.), or to fetch parts of the stream on the fly in your rails application as part of your response to HTTP requests.

Which one of those makes sense for you depends on what you are trying to do with the data and how much of the stream you need.

Problem

How would one consume a streaming api (like the twitter streaming api) with rails on heroku? Would it involve keeping a script running with a worker that consumes the stream? If there are any existing resources that document this please link, I have not been able to find much so far.

Original source