Reputation: 2983
I want to integrate Twitter in my iPhone App for getting some tweets of a particular twitter account. Please suggest me the best idea to do that ?
NOTE:
I just want to show the tweets from a particular account. Any short method will be help full rather than full twitter integration
For now I am using RSS to get the tweets but somewhere I've heard that RSS twitter feeds are very unreliable and they are going to stop support for RSS soon.
Upvotes: 0
Views: 3723
Reputation: 1932
https://github.com/jaanus/PlainOAuth/tree/27a8631a5e32c36ea40d532c8343fafe7cc5e95c And download the source project..
This links provide you last five tweets..
Upvotes: 2
Reputation: 2983
Got the answer. - I added MGTwitterEngine into my project.
Here is the code :[MyViewController's -(void)viewDidLoad]-
MGTwitterEngine *twitterEngine = [[MGTwitterEngine alloc] initWithDelegate:self];
[twitterEngine getUserTimelineFor:username sinceID:0 startingAtPage:0 count:10];
If you guys need some more clarification feel free to ask. I'll try to help you out as much as I can.
Regards!!
Upvotes: 1
Reputation: 679
If you don't want to use a full implementation, you just need to perform a query to the statuses of the specific user For example, to get the last 20 tweet from charliesheen with ASIHTTPRequest
NSURL *url = [NSURL URLWithString:@"http://twitter.com/statuses/user_timeline/charliesheen.xml"];
ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url];
[request setDelegate:self];
[request startAsynchronous];
- (void)requestFinished:(ASIHTTPRequest *)request {
// this is called if the request is successful
}
- (void)requestFailed:(ASIHTTPRequest *)request {
// this is called if the request fails
}
If don't want to use xml, just change it to json
http://twitter.com/statuses/user_timeline/charliesheen.json
Upvotes: 2