2011-11-15 43 views
3

我正在使用Twitter客戶端,我正在使用tweepy,但使用它我無法獲取user_timeline中的實體。我怎樣才能得到這些實體? 讓某人更新了AppEngine Library的Tweepy?Tweepy實體Appengine

+1

說「我不能做x」不是很有用,除非你告訴我們_why_你不能做x。當你嘗試時會發生什麼? –

+0

請注意,您正在使用應用引擎,這意味着您與許多人共享公共IP。這可能會導致您對公共職能進行費率限制,而不需要身份驗證,但是會根據您的IP對您進行評級。但是user_timeline不應該是這種情況? –

+0

嘿,尼克和山姆。我遇到了同樣的問題。讓我來給你更多的細節:在tweepy中調用user_timeline時,include_entities和include_rts不起作用。當你打電話給home_timeline時,他們會工作。所有呼叫都啓用了oauth,這意味着twitter不會查看IP(無論如何都是在本地運行)。我不得不進入tweepy API類,並將兩個屬性添加到user_timeline下允許的屬性,我還必須啓用user_timeline oauth。這些只是簡單的配置。我檢查了從Twitter返回的JSON,RT中沒有實體存在。 –

回答

2

tweepy wiki

# Iterate through the first 200 statuses in the friends timeline 
for status in tweepy.Cursor(api.friends_timeline).items(200): 
    # Process the status here 
    process_status(status) 
+0

呃,我不能低頭。我需要將媒體網址存儲在user_timeline的實體中。你能澄清一下嗎? – Max

+0

完整示例:http://code.google.com/p/pranav/source/browse/#hg%2Fgae-tweepy – pradeek

1

您需要提供include_entities = True

api.user_timeline(include_entities = True). 

這不是設置爲true默認的原因是因爲實體加入到Twitter的API後,和因此稍後將其添加到Tweepy。

相關問題