DEV Community

Discussion on: How to build a simple Twitter bot in 17 lines of code

Collapse
 
sscarduzio profile image
Simone Scarduzio

So if I want this to be a Serverless app, I'd need to run it periodically to poll twitter for new tweets. Right?

Is there anything in the Twitter API or (any other service) that callbacks my app URL upon new tweets from a list of users?

Collapse
 
zalithka profile image
Andre Greeff

From what I can tell, Twit.stream() keeps an active connection to the Twitter API, so there's no polling required to get information. In this case, a handler is being attached to the tweet event, which should stay active as long as the app is running.

Collapse
 
sscarduzio profile image
Simone Scarduzio

Thanks Andre, so yes. It's not callback based. Serverless fail :(