2011-08-25 113 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 
相關問題