2016-12-06 72 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)