Guilherme Defreitas
Guilherme Defreitas

Reputation: 1054

Ruby gem Stream API like twitter

Is there any gem for ruby (I want to use it in a rails app) that does something like Twitter Stream API. Keep the http conection open and send information in real time basis, in a query or events.

Upvotes: 0

Views: 1005

Answers (4)

Niket
Niket

Reputation: 1115

Twitter Gem has added streaming functionality. you can check that out

Upvotes: 0

RSK
RSK

Reputation: 17516

twitterstream gem worked best for me

Upvotes: 0

James Mead
James Mead

Reputation: 3502

I think twitter-stream should do what you want.

Upvotes: 1

hellvinz
hellvinz

Reputation: 3500

You need:

  • a server that speaks HTTP in order to be able to understand queries and respond valid HTTP to the client
  • an asynchronous system that will push updates in the connection established with the client when there's new data available.

Then thin is an options you might consider, it has a builtin http parser for the first requirement, and eventmachine for the second.

Have a look at this example (run it with thin --rackup async_tailer.ru start). It is tailing asynchronously the /var/log/syslog through a open http connection. You can adapt this example to send data from other asynchronous sources from which you would like data to come.

Upvotes: 3

Related Questions