2016-12-06 13 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のように、retweetsの構造は通常のつぶやきとは少し異なります。

ように見える何か:

あなたの場合

tweet |_ retweeted_status |_ entities

は、あなたがのようなものを使用したいと思うでしょう...

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

関連する問題