2
votes

If I just do a simple twitter API request for the following tweet, it should have multiple images attached to it, but it returns nothing in the media entity object

https://twitter.com/taloncopters/status/780281505826299904

This is the request I am doing: https://api.twitter.com/1.1/statuses/show/780281505826299904.json

And here's my entities object:

{
  :hashtags=>[{:text=>"rescue", :indices=>[17, 24]}, {:text=>"SAR", :indices=>[110, 114]}], 
  :symbols=>[], 
  :user_mentions=>[
    {:screen_name=>"Ravensoars", :name=>"Jim", :id=>2568464354, :id_str=>"2568464354", :indices=>[38, 49]}, 
    {:screen_name=>"CoquitlamSAR", :name=>"Coquitlam SAR", :id=>203212566, :id_str=>"203212566", :indices=>[54, 67]}
  ], 
  :urls=>[{:url=>"SHORTENED_URL", :expanded_url=>"https://twitter.com/i/web/status/780281505826299904", :display_url=>"twitter.com/i/web/status/7…", :indices=>[116, 139]}]
}

No images, or even a media key, despite there being several when you view the tweet directly.

Any way to get those images?

2

2 Answers

9
votes

Look like twitter updated their API last week. Needed to add tweet_mode: 'extended' to my calls.

1
votes

For those using oAuth Twitter Feed for Developers you simply add ['tweet_mode' => 'extended'] as the third parameter on your getTweets() function.

Example:

<?php $tweets = getTweets($number_of_tweets, $twitter_screenname_to_load, ['tweet_mode' => 'extended']); ?>