例如,对于我当前的代码,this tweet显示为:
Stunning ride through the Oxfordshire lanes this morning to get the legs ready for the Fast Test… https:// t.co/W0uFKU9jCr
我想看起来像Twitter网站上显示的那样,例如:
Stunning ride through the Oxfordshire lanes this morning to get the legs ready for the Fast Test… https://www.instagram.com/p/BSocl5Djf5v/
我该怎么做呢?我的意思是用媒体的网址,扩展的网址,tweet的引语取代Twitter的短网址。。。我知道这与json中的'entities' object有关,但我不确定如何在代码中处理它
for status in new_tweets:
if ('RT @' not in status.full_text):
id = status.id
text = status.full_text
你是对的,你需要使用实体。您可以获得如下扩展的\u url:
你可以通过连接url来打印
^{pr2}$并不是说这个代码只在tweet有url时才会打印,所以我相信如果没有共享媒体链接,它就不会打印tweet。在
相关问题 更多 >
编程相关推荐