【发布时间】:2017-09-04 00:26:24
【问题描述】:
例如,使用我当前的代码,this tweet 显示为:
今早穿过牛津郡的小巷,为快速测试做好准备……https://t.co/W0uFKU9jCr
我希望看起来像 Twitter 网站上显示的那样,例如:
今早穿越牛津郡小巷,为快速测试做好准备……https://www.instagram.com/p/BSocl5Djf5v/
我该怎么做呢?我的意思是用媒体网址、扩展网址、推文引号替换 Twitter 的短网址……我知道这与 json 中的 'entities' object 有关,但我不确定如何在我的代码中处理它
for status in new_tweets:
if ('RT @' not in status.full_text):
id = status.id
text = status.full_text
【问题讨论】:
标签: python python-2.7 twitter tweepy