Hello,
there is this tweet:
that displayed into twitter website seems to have an attached image.
But when I retrieve data from the REST API about this tweet I get the following JSON that instead of containing media/images entity entry for that image, it has an urls entity instead. And then, our code fails to recognise it has having an image attached because, our code doesn’t parse urls but it’s looking for media/images entries.
Why this is happening ?
=== JSON of tweet returned from REST API ===
{
"created_at": "Tue Feb 14 09:49:05 +0000 2017",
"id": 831440116371578880,
"id_str": "831440116371578880",
"text": "@greateranglia #ShareTheGAlove shout out to this lovely couple who just got married and kindly donated to our chose\\u2026 https:\\/\\/t.co\\/4EecCsOSgf",
"truncated": true,
"entities": {
"hashtags": [{
"text": "ShareTheGAlove",
"indices": [15, 30]
}],
"symbols": [],
"user_mentions": [{
"screen_name": "greateranglia",
"name": "Greater Anglia",
"id": 157996395,
"id_str": "157996395",
"indices": [0, 14]
}],
"urls": [{
"url": "https:\\/\\/t.co\\/4EecCsOSgf",
"expanded_url": "https:\\/\\/twitter.com\\/i\\/web\\/status\\/831440116371578880",
"display_url": "twitter.com\\/i\\/web\\/status\\/8\\u2026",
"indices": [117, 140]
}]
},
"source": "<a href=\\"
http: \\ /\\/twitter.com\\ / download\\ / iphone\\ " rel=\\"
nofollow\\ ">Twitter for iPhone<\\/a>",
"in_reply_to_status_id": null,
"in_reply_to_status_id_str": null,
"in_reply_to_user_id": 157996395,
"in_reply_to_user_id_str": "157996395",
"in_reply_to_screen_name": "greateranglia",
"user": {
"id": 20615856,
"id_str": "20615856",
"name": "Nicola",
"screen_name": "faireunepipi",
"location": "Norwich",
"description": "",
"url": null,
"entities": {
"description": {
"urls": []
}
},
"protected": false,
"followers_count": 42,
"friends_count": 174,
"listed_count": 0,
"created_at": "Wed Feb 11 19:18:05 +0000 2009",
"favourites_count": 182,
"utc_offset": null,
"time_zone": null,
"geo_enabled": true,
"verified": false,
"statuses_count": 177,
"lang": "en",
"contributors_enabled": false,
"is_translator": false,
"is_translation_enabled": false,
"profile_background_color": "352726",
"profile_background_image_url": "http:\\/\\/abs.twimg.com\\/images\\/themes\\/theme5\\/bg.gif",
"profile_background_image_url_https": "https:\\/\\/abs.twimg.com\\/images\\/themes\\/theme5\\/bg.gif",
"profile_background_tile": false,
"profile_image_url": "http:\\/\\/pbs.twimg.com\\/profile_images\\/1134654672\\/ca02a16d-a6f3-44c6-a077-af86205130bf_normal.png",
"profile_image_url_https": "https:\\/\\/pbs.twimg.com\\/profile_images\\/1134654672\\/ca02a16d-a6f3-44c6-a077-af86205130bf_normal.png",
"profile_link_color": "D02B55",
"profile_sidebar_border_color": "829D5E",
"profile_sidebar_fill_color": "99CC33",
"profile_text_color": "3E4415",
"profile_use_background_image": true,
"has_extended_profile": false,
"default_profile": false,
"default_profile_image": false,
"following": null,
"follow_request_sent": null,
"notifications": null,
"translator_type": "none"
},
"geo": null,
"coordinates": null,
"place": null,
"contributors": null,
"is_quote_status": false,
"retweet_count": 1,
"favorite_count": 1,
"favorited": false,
"retweeted": false,
"possibly_sensitive": false,
"possibly_sensitive_appealable": false,
"lang": "en"
}