Twitter API for iPhone?

596 Views Asked by At

I want to integrate my app with twitter. I need to show tweets containing certain hashtags or from a particular user.

I tried MGTwitterEngine+xOAuth, but i want twitter tweets only so no need of authentication required. MGTwitterEngine+xOAuth needs authentication so any API or method to get tweets certain hashtags or from a particular user.

2

There are 2 best solutions below

0
On BEST ANSWER

you are right, you don't neeed xOAth to make a search according to twitter search API. If you want to use MGTwitterEngine you can use one of those methods :

// Search method

- (NSString *)getSearchResultsForQuery:(NSString *)query;
- (NSString *)getSearchResultsForQuery:(NSString *)query sinceID:(MGTwitterEngineID)sinceID startingAtPage:(int)pageNum count:(int)count; // search
- (NSString *)getSearchResultsForQuery:(NSString *)query sinceID:(MGTwitterEngineID)sinceID startingAtPage:(int)pageNum count:(int)count geocode:(NSString *)geocode;

You can find more details in MGTwitterEngine.h. It seems that you don't have to set authentification parameters to make a search, you just have to create an engine :

twitterEngine = [[MGTwitterEngine alloc] initWithDelegate:self];

2
On

You can use MGTwitterEngine with search api or you can call twitter search API directly. The problems with search API is that you can only get tweets up to 14 days old. It can be as easy as: http://search.twitter.com/search.json?q=%23hello