本文介绍了Twitter API"retweeted_status" "home_timeline"字段中的字段要求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的iPhone应用程序中使用MGTwitterEngine + OAuth.一切正常,但是当我使用include_rt选项请求friends_timeline的home_timeline时,我并没有得到retweeted_status字段.

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响应中应包含用于转发的"retweeted_status"结构(如您在示例中所见).它描述了转推的源推文.

dev.twitter.com/doc/get/statuses/home_timelineResponce 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如果您将使用Twitter控制台-您将成功获得此结构.

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

但是我的应用程序将此结构接收为空.就像<转推的状态> \ n</retweeted_status>".除此之外,所有请求都运行良好.

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:我找到了这个 http://www.mail-archive.com/twitter [email protected]/msg25383.html 和一些类似的讨论,但是如果这是真的,那就太疯狂了. )

PS: I've find thishttp://www.mail-archive.com/[email protected]/msg25383.htmland a few similar discussions, but this is madness if it is true. )

谢谢.

推荐答案

我找到了答案.太简单了.SAOAuthTwitterEngine引擎使用MGTwitterEngine,但允许它使用OAuth.但是此引擎使用的是2008年创建的MGTwitterEngine,当时MGTwitterEngine不知道"retweeted_status",因为此功能稍后出现.

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.

无论如何.我需要做的一切-如果要添加[elementName isEqualToString:@"retweeted_status"]大小写

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

  • (void)解析器:(NSXMLParser *)theParser didStartElement:(NSString *)elementNamenamespaceURI:(NSString *)名称空间URIqualifiedName:(NSString *)qualifiedName属性:(NSDictionary *)attributeDict
  • (void)parser:(NSXMLParser *)theParser didStartElement:(NSString *)elementNamenamespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qualifiedNameattributes:(NSDictionary *)attributeDict

  • (void)解析器:(NSXMLParser *)theParser didEndElement:(NSString *)elementNamenamespaceURI:(NSString *)namespaceURIqualifiedName:(NSString *)qName
  • (void)parser:(NSXMLParser *)theParser didEndElement:(NSString *)elementNamenamespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName

方法类似于[elementName isEqualToString:@"status"]情况.

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

这篇关于Twitter API"retweeted_status" "home_timeline"字段中的字段要求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-01 04:08