2011-08-25 71 views
0

我想在我的iPhone应用程序中集成Twitter以获取特定Twitter帐户的推文。请建议我这样做的最佳想法?Twitter集成在iPhone应用程序

注:

1)我只是想表明从特定帐户的鸣叫。任何短期 方法将有助于充分,而不是完整的Twitter的整合

2)现在我使用的RSS得到鸣叫,但某处我听说 是RSS Twitter的饲料是非常不可靠,他们将停止 即将支持RSS。

Regards !!

回答

1

得到了答案。 - 我将MGTwitterEngine添加到我的项目中。

下面是代码:[MyViewController的 - (无效)viewDidLoad中] -

MGTwitterEngine *twitterEngine = [[MGTwitterEngine alloc] initWithDelegate:self]; 
[twitterEngine getUserTimelineFor:username sinceID:0 startingAtPage:0 count:10]; 

如果你们需要一些更多的澄清,随便问。我会尽我所能帮助你。

Regards !!

2

如果你不想使用完整的实现,你只需要执行一个查询特定用户 的状态。例如,为了从查理·辛在过去的20鸣叫与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 
} 

如果不想使用xml,只需将其更改为json

http://twitter.com/statuses/user_timeline/charliesheen.json 
相关问题