我想使用python和thisTwitter包从Twitter api获取伊朗的Twitter趋势:
import twitter
#WOE_ID Obtained from http://woeid.rosselliot.co.nz/lookup/iran
IR_WOE_ID = 23424851
auth = twitter.oauth.OAuth(OAUTH_TOKEN, OAUTH_TOKEN_SECRET,
CONSUMER_KEY, CONSUMER_SECRET)
twitter_api = twitter.Twitter(auth=auth)
print twitter_api
ir_trends = twitter_api.trends.place(_id=IR_WOE_ID)
print ir_trends
作为回应,我得到
twitter.api.TwitterHTTPError: Twitter sent status 404 for URL: 1.1/trends/place.json using parameters: (id=2251945&oauth_consumer_key=***&oauth_nonce=***&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1530506965&oauth_token=***&oauth_version=1.0&oauth_signature=***)
details: {u'errors': [{u'message': u'Sorry, that page does not exist.', u'code': 34}]}
对于其他的WOE\u ID国家代码,比如India
和US
,我没有发现任何错误。你知道吗
这里可能有什么问题?我怎样才能解决这个问题?你知道吗
Twitter似乎没有任何伊朗的趋势。你知道吗
Twitter没有任何伊朗的趋势,一些在线工具也没有伊朗在他们的列表中TwitterTrends.infotrends24.in。。。似乎twitter完全禁止了伊朗
相关问题 更多 >
编程相关推荐