Twitter - Constant search for term
I wonder if anyone can help me, I'm getting a little confused as to which API to use. If anyone can offer some guidance I would really appreciate it.
I'm trying to create an website where users can monitor Twitter for certain hashtags. The site will continually search twitter for any new updates and store any tweet related to that particular hashtag. This process will run for up to 60 days.
As far as I can gather, my two options are:
Using the Search API The problem with this API is that if I have a 1000 users all monitoring different hashtags, I am quickly going to reach my API limit since I will be making a fair few requests, potentially once every 2-3 minutes. Is there a way to use oauth in conjunction with the search API so that the limits are user based and not application based? That way, the limit will be user specific and I won't have to worry.
Using the Stream API I thought this might be a better solution, but it seems you are limited to how many connections you can have open. The documentation seems unclear as to how this works... is the connection limit per twitter account or service ip? For example, if my site had 1000 users each of those users was monitoring a hashtag, would those 1000 stream api c开发者_StackOverflow中文版onnections be against my servers ip or would they against the user?
You will want to use the Streaming API. You will open a single connection that will track the terms for all of the users. When users add new terms to track you will restart the stream with the new terms. The single stream will be for a bot Twitter account you create and not your users accounts.
精彩评论