开发者

Twitter API "retweeted_status" field in "home_timeline" request

开发者 https://www.devze.com 2023-01-28 08:21 出处:网络
I\'m using MGTwitterEngine + OAuth in my iPhone application. All works fine, but when I\'m requesting home_timeline of friends_timeline with include_rt option I\'m not getting retweeted_status field.

I'm using MGTwitterEngine + OAuth in my iPhone application. All works fine, but when I'm requesting home_timeline of friends_timeline with include_rt option I'm not getting retweeted_status field.

dev.twitter.com/doc/get/statuses/home_timeline Responce should contain "retweeted_status" structure for retweets (as you can see in the sample). It describes source tweet that was retweeted.

dev.twitter.com/console If you will use Twitter Console - you will get this structure successfully.

But my app recieves this structure as empty. Like " < retweeted_status>\n< /retweeted_status>". All requests are working great except this.

Have anyone seen this? What's the solution?

PS: I've find this http://www.mail-archive.com/twitter-development-talk@googlegroups.com/msg25383.html and a few similar discussions, but this is madn开发者_高级运维ess if it is true. )

Thanks.


I've found the answer. It was so simple. SAOAuthTwitterEngine engine uses MGTwitterEngine but allows it to use OAuth. But this engine is using MGTwitterEngine created in 2008, when MGTwitterEngine didn't know about "retweeted_status" because this feature appeared later.

Anyway. All I was need to do - if to add [elementName isEqualToString:@"retweeted_status"] case for

  • (void)parser:(NSXMLParser *)theParser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qualifiedName attributes:(NSDictionary *)attributeDict

and

  • (void)parser:(NSXMLParser *)theParser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName

methods in MGTwitterStatusesParser.m similarly to [elementName isEqualToString:@"status"] case.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号