开发者

How to build a twitter stream parser in ruby?

开发者 https://www.devze.com 2023-03-24 11:10 出处:网络
i want to build a parser, which runs in the background and reads reads tweets with a specific @ reply in it every minute. should i use cronjobs or daemons? any advice here?

i want to build a parser, which runs in the background and reads reads tweets with a specific @ reply in it every minute. should i use cronjobs or daemons? any advice here?

is the开发者_StackOverflow中文版re a gems for this?

thank you


Definitely go with a cron_job here. And I like to use the json gem and simply parse the search results of a public timeline. Twitter has a nice, simple, but slightly unreliable, json API.


I would opt to use a daemon for this task. If you do choose to go the cronjob route, make sure your app can handle multiple processes running at once (or use a lock-file or other mechanism to make sure your job won't run concurrently). Since the HTTP request timeout is longer than a minute, you are almost guaranteed to encounter this issue on a semi-frequent basis.

0

精彩评论

暂无评论...
验证码 换一张
取 消