KingPolygon
KingPolygon

Reputation: 4755

iOS: Fastest Way to Find a Specific Tweet Once it is tweeted?

I want to scan a specific account's tweets (not necessarily my own) for tweets containing a specific phrase and a url entity. For example if they send out a tweet like (Click here for an invite: linkHere), I want to be able to open it as soon as possible. What is the fastest way to do this in iOS?

Say the tweet will be sent out at 12am, I would run this at 11:59pm, hoping to catch the tweet as soon as it is sent (So I'd probably only want to parse tweets created after I've began running this query).

I've been looking at twitter's streaming api and rest api but I'm not sure what would be more appropriate for what I need. Has anyone used STTwitter? Last but not least, would it be best to use NSUrlSession or AFNetworking 2.0 for this? My goal would be that once the link inside that tweet was found, I would open it in a webview.

The key here for me is speed. The faster I find it and open it, the better. Thank you very much.

Upvotes: 0

Views: 92

Answers (1)

nst
nst

Reputation: 3882

Polling the account would exhaust the API limit rates.

That's why you should use the streaming API.

You can setup STTwitter to call you back when the tweet is posted.

You would then implement your own filters in the callback.

Upvotes: 1

Related Questions