Getting media from search results that use Twitter cards

media
search
cards

#1

After running a search for “nasa filter:media” one of the results was this status id: 784513332023857153

The problem is the image is not present anywhere in the API response.
I see the image is in the twitter:image meta tag (Twitter card) on the page referenced by the original tweet.

So that might be the reason why this status was included when using the media filter.
Is there a way to get that image included in the search response?
Or to avoid getting results without directly accessible media?
Thanks.


#2

In that particular tweet: 784513332023857153 is a retweet, so the media items can be found in retweeted_status object.

For other tweets with cards eg: https://twitter.com/MacWBishop/status/785082808909885440 the card info is in the html of the page http://www.bbc.com/news/world-europe-37597075 look for <meta name="twitter:* tags


#3

Hi @IgorBrigadir!
First of all, thanks a lot for your answer!

So… The only way to get media for a tweet linking to a web page using cards is to scrape that page?
If that’s the case… Is there a way to avoid the API from returning those tweets?

I’m currently filtering tweets without media urls but the idea was to get tweets with media urls only and avoid the extra work of filtering them.

I’m rendering an image gallery, so I’m only interesting in media:

Cheers!