2016-12-06 74 views
0

嘿,我可以从原来的推特,但从转推我得到的图像是文本,但不是图像。有没有办法得到这个?如何从转推中获取图像?

var tweet = twt[i] //here I get the twitter posts 
console.log(tweet.text) //return the tweet text 
console.log(tweet.entities.media[0].media_url) //return tweet image but only if the image is part of the original post 

回答

0

,你从the documentation on retweeting见,锐推的结构与普通的鸣叫略有不同。

的表情是这样的:

tweet |_ retweeted_status |_ entities

在你的情况,你将要使用的东西像...

console.log(tweet.retweeted_status.entities.media[0].media_url)