When I look at this tweet, the media entity I receive is:
{
id: 1291683183411437600,
id_str: '1291683183411437568',
indices: [ 149, 172 ],
media_url: 'http://pbs.twimg.com/tweet_video_thumb/Eez7Av2VoAAK58T.jpg',
media_url_https: 'https://pbs.twimg.com/tweet_video_thumb/Eez7Av2VoAAK58T.jpg',
url: 'STACKOVERFLOW TOLD ME TO REMOVE THIS URL',
display_url: 'pic.twitter.com/I3Clni8MeD',
expanded_url: 'https://twitter.com/_Weeekly/status/1291683199240695809/photo/1',
type: 'photo',
sizes: {
thumb: { w: 150, h: 150, resize: 'crop' },
medium: { w: 846, h: 1200, resize: 'fit' },
large: { w: 1024, h: 1452, resize: 'fit' },
small: { w: 480, h: 680, resize: 'fit' }
}
}
The function I am using for this task is as follows:
let params = {
screen_name: tweeter.tweeter,
since_id: parseInt(tweeter.latestTweetId),
include_rts: true,
tweet_mode: "extended",
count: 1000
};
twitterClient.get("statuses/user_timeline", params, async function (
error,
tweets
) {
//code
}
Is there a way to extract the gifs/video links from the user_timeline data?