Reputation: 982
I am working on an app where I need to perform an action whenever I tweet. (just ping a URL or whatever)
Is there a way to do this without polling?
Example:
It seems like the twitter app that I created a dev.twitter.com and then authorized on my account should be aware of when that account tweets. is there a trigger or something?
How does IFTTT do this? I have some recipes with them that trigger whenever I tweet. Are they just polling twitter?
The same goes for the facebook connectivity that publishes your tweet to facebook. What hook are they using to accomplish this?
I'm using the twitter gem on a Rails 4.1 application right now, but I'm stuck on this part. Please help. any guidance is very appreciated!
Upvotes: 1
Views: 312
Reputation: 5416
Use the Twitter Streaming API - https://dev.twitter.com/docs/api/streaming or, you can poll every few seconds (be sure to check the API rate limit).
Upvotes: 2