javascript - Twitter API not returning images - Stack Overflow

If I just do a simple twitter API request for the following tweet, it should have multiple images attac

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

This is the request I am doing: .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=>"", :display_url=>"twitter/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?

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./taloncopters/status/780281505826299904

This is the request I am doing: https://api.twitter./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./i/web/status/780281505826299904", :display_url=>"twitter./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?

Share Improve this question asked Sep 26, 2016 at 18:06 goddamnyouryangoddamnyouryan 6,90615 gold badges58 silver badges108 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 9

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

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']); ?>

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744722596a4589999.html

相关推荐

  • javascript - Twitter API not returning images - Stack Overflow

    If I just do a simple twitter API request for the following tweet, it should have multiple images attac

    19小时前
    40

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信