我有以下代码只查找带有地理标记的英文推文:
for tweet in tweepy.Cursor(api.search,
q="google",
geocode="40.7142700,-74.0059,5000km",
rpp=100,
result_type="recent",
include_entities=True,
lang="en").items():
print (tweet.created_at,tweet.text)
现在我如何打印推文的创建日期和推文的位置?我尝试了 tweet.geocode 和 tweet.locale 等不同的东西,但没有成功。请帮助我,谢谢
请您参考如下方法:
您需要查看 tweet.place。它记录在这里:https://developer.twitter.com/en/docs/tweets/data-dictionary/overview/tweet-object
但是,即使 Twitter 可能会返回一条或多条与您提供的地理编码相对应的推文,这些推文并不总是包含 place 对象。
