Search code examples
rubytwittertweetstream

Stream Live tweets from a specific user (Ruby)


I am using the tweetstream gem in order to communicate with the Twitter API. I am able to stream tweets, and won't mind switching to the regular twitter gem if I need to. I just want to get live updates of when a specific account posts. What is the best way of doing this in ruby?


Solution

  • If you want live updates of when a specific account posts then take a look at webhooks. Webhooks allow you to build or set up Twitter App which subscribes to certain events on twitter.com. The advantage of using webhooks is that Twitter would send you a payload as a POST request to your app and then your job would to handle this response in your app accordingly. This assumes that you have an app server running locally, like rails server. The advantage is also that it happens asynchronoysly and you do not need to manually hit Twitter API every now and then to know if there were any updates