更新情報(5/23以降)
西海岸(太平洋)夏時間5/28(の0時)(日本時間5/28 16時)に写真複数添付機能がAPIに追加されます。
On May 28th PDT (UTC-7) we will launch support for composing tweets with multiple images via the REST API. Details: https://t.co/XB1rnLfFmo
— Twitter API (@twitterapi) May 22, 2014
追加されるAPIの詳細はこちら。
ポイントは
- APIの返答に、写真へのリンク情報が含まれていた"entities"に加えて、"extended_entities"が加わります
- "extended_entities/media"の第1要素は"entities/media"と全く同じ(多分)
- 写真以外のメディアの添付が可能になる(かも)
- メディア数が4つ以上の添付が可能になる(かも)
「かも」付けしてあるのは、まだ不明な項目です。
追記:5/28 1時〜2時
写真が複数枚添付されているTwitter::Tweetインスタンスをmultiphototweetと書くことにすると、entities以下のmediaにある要素についてTwitter gem(v. 5.9.0)では以下のようなアクセスが行えます。
> multiphototweet.media.first.attrs => {:id=>449746301068926976, :id_str=>"449746301068926976", :indices=>[118, 140], :media_url=>"http://pbs.twimg.com/media/Bj3R4MJCYAAqnMg.jpg", :media_url_https=>"https://pbs.twimg.com/media/Bj3R4MJCYAAqnMg.jpg", :url=>"http://t.co/Mljw3xOY3B", :display_url=>"pic.twitter.com/Mljw3xOY3B", :expanded_url=> "http://twitter.com/riocampos/status/449746301857447936/photo/1", :type=>"photo", :sizes=> {:medium=>{:w=>600, :h=>537, :resize=>"fit"}, :small=>{:w=>340, :h=>304, :resize=>"fit"}, :thumb=>{:w=>150, :h=>150, :resize=>"crop"}, :large=>{:w=>640, :h=>573, :resize=>"fit"}}} > multiphototweet.media.first.media_url => #<Addressable::URI:0x3fdd89580920 URI:http://pbs.twimg.com/media/Bj3R4MJCYAAqnMg.jpg>
extended_entities/mediaの第1要素はentities/mediaと同じっぽいので、Twitter gemは今後のアップデートでTwitter::Tweet#mediaをextended_entitiesのなかのmediaを取得するように変更するはずです。
とはいえ、いままでのTwitter gemでも、Twitter::Tweetオブジェクトに対してTwitter::Tweet#attrs(または#to_h)でシンボルをキーとしたハッシュを返してくれます。これはJSONをそのまま展開しているだけです*1。なので
multiphototweet.attrs[:extended_entities][:media].first
で1枚目の写真に関するハッシュ(multiphototweet.media.first.attrsおよびmultiphototweet.attrs[:entities][:media].firstと同じハッシュ)が取得できる、と推測されます。
全ては、日本時間5/28 16時に明らかになります。
5/28〜29追記
(5/28 16時半 18時 20時 23時半 5/29 1時 2時半 現在、まだ追加されていません。)
5/31 12時追記:新APIが有効になりました
Twitter gemでのアクセスでもextended_entitiesが見れてます\o/
multiphototweet = client.status('449746301857447936') multiphototweet.attrs => {:created_at=>"Sat Mar 29 03:14:08 +0000 2014", :id=>449746301857447936, :id_str=>"449746301857447936", :text=> "タグ付けされた側は通知が来る。そしてタグ付けを含むツイートには(ツイートした垢が鍵付きじゃなければ、タグ付けに関係しない垢からも)タグ付けされた垢名を確認できる。\n新機能の写真タグ付けに加え、写真は1ツイート4枚まで追加可能になった。 http://t.co/Mljw3xOY3B", :source=> "<a href=\"http://twitter.com/download/iphone\" rel=\"nofollow\">Twitter for iPhone</a>", :truncated=>false, :in_reply_to_status_id=>nil, :in_reply_to_status_id_str=>nil, :in_reply_to_user_id=>nil, :in_reply_to_user_id_str=>nil, :in_reply_to_screen_name=>nil, :user=> {:id=>56997313, :id_str=>"56997313", :name=>"riocampos(りおかんぽす)", :screen_name=>"riocampos", :location=>"Osaka, Japan", :description=> "plz call me rio☆ favorite: cycle road race & figure skate, Mac!, iPhone!, Ruby, Fine-Art, Science, Black/Green Tea. | Gender:♂ (FB: http://t.co/71QgiSwca0 )", :url=>"http://t.co/cRXTvrEpoN", :entities=> {:url=> {:urls=> [{:url=>"http://t.co/cRXTvrEpoN", :expanded_url=>"http://about.me/riocampos", :display_url=>"about.me/riocampos", :indices=>[0, 22]}]}, :description=> {:urls=> [{:url=>"http://t.co/71QgiSwca0", :expanded_url=>"http://on.fb.me/MvEV7P", :display_url=>"on.fb.me/MvEV7P", :indices=>[132, 154]}]}}, :protected=>false, :followers_count=>2121, :friends_count=>2326, :listed_count=>191, :created_at=>"Wed Jul 15 12:02:35 +0000 2009", :favourites_count=>2947, :utc_offset=>32400, :time_zone=>"Osaka", :geo_enabled=>true, :verified=>false, :statuses_count=>182200, :lang=>"en", :contributors_enabled=>false, :is_translator=>false, :is_translation_enabled=>false, :profile_background_color=>"48E0B7", :profile_background_image_url=> "http://pbs.twimg.com/profile_background_images/378800000158576090/WjPzbAXY.jpeg", :profile_background_image_url_https=> "https://pbs.twimg.com/profile_background_images/378800000158576090/WjPzbAXY.jpeg", :profile_background_tile=>true, :profile_image_url=> "http://pbs.twimg.com/profile_images/3462273402/f331afb1b57c7d39688229e86de95881_normal.jpeg", :profile_image_url_https=> "https://pbs.twimg.com/profile_images/3462273402/f331afb1b57c7d39688229e86de95881_normal.jpeg", :profile_banner_url=> "https://pbs.twimg.com/profile_banners/56997313/1365179721", :profile_link_color=>"009999", :profile_sidebar_border_color=>"FFFFFF", :profile_sidebar_fill_color=>"EFEFEF", :profile_text_color=>"333333", :profile_use_background_image=>true, :default_profile=>false, :default_profile_image=>false, :following=>false, :follow_request_sent=>false, :notifications=>false}, :geo=>nil, :coordinates=>nil, :place=>nil, :contributors=>nil, :retweet_count=>0, :favorite_count=>1, :entities=> {:hashtags=>[], :symbols=>[], :urls=>[], :user_mentions=>[], :media=> [{:id=>449746301068926976, :id_str=>"449746301068926976", :indices=>[118, 140], :media_url=>"http://pbs.twimg.com/media/Bj3R4MJCYAAqnMg.jpg", :media_url_https=>"https://pbs.twimg.com/media/Bj3R4MJCYAAqnMg.jpg", :url=>"http://t.co/Mljw3xOY3B", :display_url=>"pic.twitter.com/Mljw3xOY3B", :expanded_url=> "http://twitter.com/riocampos/status/449746301857447936/photo/1", :type=>"photo", :sizes=> {:medium=>{:w=>600, :h=>537, :resize=>"fit"}, :small=>{:w=>340, :h=>304, :resize=>"fit"}, :thumb=>{:w=>150, :h=>150, :resize=>"crop"}, :large=>{:w=>640, :h=>573, :resize=>"fit"}}}]}, :extended_entities=> {:media=> [{:id=>449746301068926976, :id_str=>"449746301068926976", :indices=>[118, 140], :media_url=>"http://pbs.twimg.com/media/Bj3R4MJCYAAqnMg.jpg", :media_url_https=>"https://pbs.twimg.com/media/Bj3R4MJCYAAqnMg.jpg", :url=>"http://t.co/Mljw3xOY3B", :display_url=>"pic.twitter.com/Mljw3xOY3B", :expanded_url=> "http://twitter.com/riocampos/status/449746301857447936/photo/1", :type=>"photo", :sizes=> {:medium=>{:w=>600, :h=>537, :resize=>"fit"}, :small=>{:w=>340, :h=>304, :resize=>"fit"}, :thumb=>{:w=>150, :h=>150, :resize=>"crop"}, :large=>{:w=>640, :h=>573, :resize=>"fit"}}}, {:id=>449746298007076864, :id_str=>"449746298007076864", :indices=>[118, 140], :media_url=>"http://pbs.twimg.com/media/Bj3R4AvCQAA9-Le.jpg", :media_url_https=>"https://pbs.twimg.com/media/Bj3R4AvCQAA9-Le.jpg", :url=>"http://t.co/Mljw3xOY3B", :display_url=>"pic.twitter.com/Mljw3xOY3B", :expanded_url=> "http://twitter.com/riocampos/status/449746301857447936/photo/1", :type=>"photo", :sizes=> {:medium=>{:w=>599, :h=>1024, :resize=>"fit"}, :large=>{:w=>599, :h=>1024, :resize=>"fit"}, :thumb=>{:w=>150, :h=>150, :resize=>"crop"}, :small=>{:w=>340, :h=>581, :resize=>"fit"}}}, {:id=>449746298887868416, :id_str=>"449746298887868416", :indices=>[118, 140], :media_url=>"http://pbs.twimg.com/media/Bj3R4EBCEAAUIgg.jpg", :media_url_https=>"https://pbs.twimg.com/media/Bj3R4EBCEAAUIgg.jpg", :url=>"http://t.co/Mljw3xOY3B", :display_url=>"pic.twitter.com/Mljw3xOY3B", :expanded_url=> "http://twitter.com/riocampos/status/449746301857447936/photo/1", :type=>"photo", :sizes=> {:small=>{:w=>340, :h=>604, :resize=>"fit"}, :large=>{:w=>576, :h=>1024, :resize=>"fit"}, :thumb=>{:w=>150, :h=>150, :resize=>"crop"}, :medium=>{:w=>576, :h=>1024, :resize=>"fit"}}}]}, :favorited=>false, :retweeted=>false, :possibly_sensitive=>false, :lang=>"ja"}
multiphototweet.attrs[:extended_entities][:media] => [{:id=>449746301068926976, :id_str=>"449746301068926976", :indices=>[118, 140], :media_url=>"http://pbs.twimg.com/media/Bj3R4MJCYAAqnMg.jpg", :media_url_https=>"https://pbs.twimg.com/media/Bj3R4MJCYAAqnMg.jpg", :url=>"http://t.co/Mljw3xOY3B", :display_url=>"pic.twitter.com/Mljw3xOY3B", :expanded_url=> "http://twitter.com/riocampos/status/449746301857447936/photo/1", :type=>"photo", :sizes=> {:medium=>{:w=>600, :h=>537, :resize=>"fit"}, :small=>{:w=>340, :h=>304, :resize=>"fit"}, :thumb=>{:w=>150, :h=>150, :resize=>"crop"}, :large=>{:w=>640, :h=>573, :resize=>"fit"}}}, {:id=>449746298007076864, :id_str=>"449746298007076864", :indices=>[118, 140], :media_url=>"http://pbs.twimg.com/media/Bj3R4AvCQAA9-Le.jpg", :media_url_https=>"https://pbs.twimg.com/media/Bj3R4AvCQAA9-Le.jpg", :url=>"http://t.co/Mljw3xOY3B", :display_url=>"pic.twitter.com/Mljw3xOY3B", :expanded_url=> "http://twitter.com/riocampos/status/449746301857447936/photo/1", :type=>"photo", :sizes=> {:medium=>{:w=>599, :h=>1024, :resize=>"fit"}, :large=>{:w=>599, :h=>1024, :resize=>"fit"}, :thumb=>{:w=>150, :h=>150, :resize=>"crop"}, :small=>{:w=>340, :h=>581, :resize=>"fit"}}}, {:id=>449746298887868416, :id_str=>"449746298887868416", :indices=>[118, 140], :media_url=>"http://pbs.twimg.com/media/Bj3R4EBCEAAUIgg.jpg", :media_url_https=>"https://pbs.twimg.com/media/Bj3R4EBCEAAUIgg.jpg", :url=>"http://t.co/Mljw3xOY3B", :display_url=>"pic.twitter.com/Mljw3xOY3B", :expanded_url=> "http://twitter.com/riocampos/status/449746301857447936/photo/1", :type=>"photo", :sizes=> {:small=>{:w=>340, :h=>604, :resize=>"fit"}, :large=>{:w=>576, :h=>1024, :resize=>"fit"}, :thumb=>{:w=>150, :h=>150, :resize=>"crop"}, :medium=>{:w=>576, :h=>1024, :resize=>"fit"}}}]
multiphototweet.attrs[:extended_entities][:media].first => {:id=>449746301068926976, :id_str=>"449746301068926976", :indices=>[118, 140], :media_url=>"http://pbs.twimg.com/media/Bj3R4MJCYAAqnMg.jpg", :media_url_https=>"https://pbs.twimg.com/media/Bj3R4MJCYAAqnMg.jpg", :url=>"http://t.co/Mljw3xOY3B", :display_url=>"pic.twitter.com/Mljw3xOY3B", :expanded_url=> "http://twitter.com/riocampos/status/449746301857447936/photo/1", :type=>"photo", :sizes=> {:medium=>{:w=>600, :h=>537, :resize=>"fit"}, :small=>{:w=>340, :h=>304, :resize=>"fit"}, :thumb=>{:w=>150, :h=>150, :resize=>"crop"}, :large=>{:w=>640, :h=>573, :resize=>"fit"}}}
本編
Twitter上の会話をより楽しみやすくするため、写真関連の機能を2つ追加しました。写真に写っている人にタグを付けたり、ツイートに最大4枚の写真を添付できるようになりました。
写真でもっと楽しみませんか
その1:タグ付け
タグ付けテスト pic.twitter.com/SuCOMQdIWt
— riocampos5 (@riocampos5) March 29, 2014
このツイートをAPIで見てみます。Twitter gem(5.7.1ただし現時点の最新は5.8.0)を使いました。
{:created_at=>"Sat Mar 29 02:58:22 +0000 2014",
:id=>449742330350682112,
:id_str=>"449742330350682112",
:text=>"タグ付けテスト http://t.co/SuCOMQdIWt",
:source=>
"<a href=\"http://twitter.com/download/iphone\" rel=\"nofollow\">Twitter for iPhone</a>",
:truncated=>false,
:in_reply_to_status_id=>nil,
:in_reply_to_status_id_str=>nil,
:in_reply_to_user_id=>nil,
:in_reply_to_user_id_str=>nil,
:in_reply_to_screen_name=>nil,
:user=>
{:id=>709067502,
:id_str=>"709067502",
:name=>"riocampos5",
:screen_name=>"riocampos5",
:location=>"",
:description=>"",
:url=>nil,
:entities=>{:description=>{:urls=>[]}},
:protected=>false,
:followers_count=>1,
:friends_count=>1,
:listed_count=>1,
:created_at=>"Sat Jul 21 14:32:44 +0000 2012",
:favourites_count=>0,
:utc_offset=>nil,
:time_zone=>nil,
:geo_enabled=>false,
:verified=>false,
:statuses_count=>285,
:lang=>"ja",
:contributors_enabled=>false,
:is_translator=>false,
:is_translation_enabled=>false,
:profile_background_color=>"C0DEED",
:profile_background_image_url=>
"http://abs.twimg.com/images/themes/theme1/bg.png",
:profile_background_image_url_https=>
"https://abs.twimg.com/images/themes/theme1/bg.png",
:profile_background_tile=>false,
:profile_image_url=>
"http://abs.twimg.com/sticky/default_profile_images/default_profile_3_normal.png",
:profile_image_url_https=>
"https://abs.twimg.com/sticky/default_profile_images/default_profile_3_normal.png",
:profile_link_color=>"0084B4",
:profile_sidebar_border_color=>"C0DEED",
:profile_sidebar_fill_color=>"DDEEF6",
:profile_text_color=>"333333",
:profile_use_background_image=>true,
:default_profile=>true,
:default_profile_image=>true,
:following=>true,
:follow_request_sent=>false,
:notifications=>false},
:geo=>nil,
:coordinates=>nil,
:place=>nil,
:contributors=>nil,
:retweet_count=>0,
:favorite_count=>0,
:entities=>
{:hashtags=>[],
:symbols=>[],
:urls=>[],
:user_mentions=>[],
:media=>
[{:id=>449742329474072576,
:id_str=>"449742329474072576",
:indices=>[8, 30],
:media_url=>"http://pbs.twimg.com/media/Bj3ORAzCQAAjy2i.jpg",
:media_url_https=>"https://pbs.twimg.com/media/Bj3ORAzCQAAjy2i.jpg",
:url=>"http://t.co/SuCOMQdIWt",
:display_url=>"pic.twitter.com/SuCOMQdIWt",
:expanded_url=>
"http://twitter.com/riocampos5/status/449742330350682112/photo/1",
:type=>"photo",
:sizes=>
{:large=>{:w=>533, :h=>533, :resize=>"fit"},
:thumb=>{:w=>150, :h=>150, :resize=>"crop"},
:medium=>{:w=>533, :h=>533, :resize=>"fit"},
:small=>{:w=>340, :h=>340, :resize=>"fit"}}}]},
:favorited=>false,
:retweeted=>false,
:possibly_sensitive=>false,
:lang=>"ja"}
…:mediaのなかに入ってるかと思いましたが入ってませんね。
ではTwitter gemを使わずOAuthを使って直接確認します。
毎度ですが、key/secretはニセモノです。
#!/usr/bin/env ruby
# coding: utf-8
require 'twitter'
require 'oauth'
key_secret = {
consumer_key: '9Gu1FiE1IfKi32bR8Fw',
consumer_secret: 'QUnRDVcl5FNCZ9C1j80OAjUJlguMNVyqbdrOrnjtQ',
access_token: '2194235326-sm2SUkVRHMJ1CdwYG1f04klQMlxc4i05tkSbnZa',
access_token_secret: 'oairK8FMvLZ8dqEVrCgh2brhyL0SCd5wpdkIoNxz62Jdi',
}
# Exchange your oauth_token and oauth_token_secret for an AccessToken instance.
def prepare_access_token(key_secret)
consumer = OAuth::Consumer.new(
key_secret[:consumer_key],
key_secret[:consumer_secret],
{
site: "https://api.twitter.com",
scheme: :header
}
)
# now create the access token object from passed values
token_hash = {
oauth_token: key_secret[:access_token],
oauth_token_secret: key_secret[:access_token_secret]
}
OAuth::AccessToken.from_hash(consumer, token_hash)
end
# Exchange our oauth_token and oauth_token secret for the AccessToken instance.
access_token = prepare_access_token(key_secret)
# use the access token as an agent to get the home timeline
response = access_token.request(:get, "https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=riocampos5&count=1")
これをpryで実行して、返ってきたのがこちら。
pry(main)> pp JSON.parse(response.body);
[{"created_at"=>"Sat Mar 29 02:58:22 +0000 2014",
"id"=>449742330350682112,
"id_str"=>"449742330350682112",
"text"=>"タグ付けテスト http://t.co/SuCOMQdIWt",
"source"=>
"<a href=\"http://twitter.com/download/iphone\" rel=\"nofollow\">Twitter for iPhone</a>",
"truncated"=>false,
"in_reply_to_status_id"=>nil,
"in_reply_to_status_id_str"=>nil,
"in_reply_to_user_id"=>nil,
"in_reply_to_user_id_str"=>nil,
"in_reply_to_screen_name"=>nil,
"user"=>
{"id"=>709067502,
"id_str"=>"709067502",
"name"=>"riocampos5",
"screen_name"=>"riocampos5",
"location"=>"",
"description"=>"",
"url"=>nil,
"entities"=>{"description"=>{"urls"=>[]}},
"protected"=>false,
"followers_count"=>1,
"friends_count"=>1,
"listed_count"=>1,
"created_at"=>"Sat Jul 21 14:32:44 +0000 2012",
"favourites_count"=>0,
"utc_offset"=>nil,
"time_zone"=>nil,
"geo_enabled"=>false,
"verified"=>false,
"statuses_count"=>285,
"lang"=>"ja",
"contributors_enabled"=>false,
"is_translator"=>false,
"is_translation_enabled"=>false,
"profile_background_color"=>"C0DEED",
"profile_background_image_url"=>
"http://abs.twimg.com/images/themes/theme1/bg.png",
"profile_background_image_url_https"=>
"https://abs.twimg.com/images/themes/theme1/bg.png",
"profile_background_tile"=>false,
"profile_image_url"=>
"http://abs.twimg.com/sticky/default_profile_images/default_profile_3_normal.png",
"profile_image_url_https"=>
"https://abs.twimg.com/sticky/default_profile_images/default_profile_3_normal.png",
"profile_link_color"=>"0084B4",
"profile_sidebar_border_color"=>"C0DEED",
"profile_sidebar_fill_color"=>"DDEEF6",
"profile_text_color"=>"333333",
"profile_use_background_image"=>true,
"default_profile"=>true,
"default_profile_image"=>true,
"following"=>true,
"follow_request_sent"=>false,
"notifications"=>false},
"geo"=>nil,
"coordinates"=>nil,
"place"=>nil,
"contributors"=>nil,
"retweet_count"=>0,
"favorite_count"=>0,
"entities"=>
{"hashtags"=>[],
"symbols"=>[],
"urls"=>[],
"user_mentions"=>[],
"media"=>
[{"id"=>449742329474072576,
"id_str"=>"449742329474072576",
"indices"=>[8, 30],
"media_url"=>"http://pbs.twimg.com/media/Bj3ORAzCQAAjy2i.jpg",
"media_url_https"=>"https://pbs.twimg.com/media/Bj3ORAzCQAAjy2i.jpg",
"url"=>"http://t.co/SuCOMQdIWt",
"display_url"=>"pic.twitter.com/SuCOMQdIWt",
"expanded_url"=>
"http://twitter.com/riocampos5/status/449742330350682112/photo/1",
"type"=>"photo",
"sizes"=>
{"large"=>{"w"=>533, "h"=>533, "resize"=>"fit"},
"thumb"=>{"w"=>150, "h"=>150, "resize"=>"crop"},
"medium"=>{"w"=>533, "h"=>533, "resize"=>"fit"},
"small"=>{"w"=>340, "h"=>340, "resize"=>"fit"}}}]},
"favorited"=>false,
"retweeted"=>false,
"possibly_sensitive"=>false,
"lang"=>"ja"}]
…Twitter gemでの返値と全く一緒です。
結局、APIでのアクセスでは、写真のタグ付け情報が含まれていませんでしたorz
その2:写真複数添付
タグ付けされた側は通知が来る。そしてタグ付けを含むツイートには(ツイートした垢が鍵付きじゃなければ、タグ付けに関係しない垢からも)タグ付けされた垢名を確認できる。
新機能の写真タグ付けに加え、写真は1ツイート4枚まで追加可能になった。 pic.twitter.com/Mljw3xOY3B
— riocampos(りおかんぽす) (@riocampos) March 29, 2014
{:created_at=>"Sat Mar 29 03:14:08 +0000 2014",
:id=>449746301857447936,
:id_str=>"449746301857447936",
:text=>
"タグ付けされた側は通知が来る。そしてタグ付けを含むツイートには(ツイートした垢が鍵付きじゃなければ、タグ付けに関係しない垢からも)タグ付けされた垢名を確認できる。\n新機能の写真タグ付けに加え、写真は1ツイート4枚まで追加可能になった。 http://t.co/Mljw3xOY3B",
:source=>
"<a href=\"http://twitter.com/download/iphone\" rel=\"nofollow\">Twitter for iPhone</a>",
:truncated=>false,
:in_reply_to_status_id=>nil,
:in_reply_to_status_id_str=>nil,
:in_reply_to_user_id=>nil,
:in_reply_to_user_id_str=>nil,
:in_reply_to_screen_name=>nil,
:user=>
{:id=>56997313,
:id_str=>"56997313",
:name=>"riocampos(りおかんぽす)",
:screen_name=>"riocampos",
:location=>"Osaka, Japan",
:description=>
"plz call me rio☆ favorite: cycle road race & figure skate, Mac!, iPhone!, Ruby, Fine-Art, Science, Black/Green Tea. | Gender:♂ facebook: http://t.co/uP8O6PBYoU",
:url=>"http://t.co/5yB3nIR3VQ",
:entities=>
{:url=>
{:urls=>
[{:url=>"http://t.co/5yB3nIR3VQ",
:expanded_url=>"http://about.me/riocampos",
:display_url=>"about.me/riocampos",
:indices=>[0, 22]}]},
:description=>
{:urls=>
[{:url=>"http://t.co/uP8O6PBYoU",
:expanded_url=>"http://on.fb.me/MvEV7P",
:display_url=>"on.fb.me/MvEV7P",
:indices=>[137, 159]}]}},
:protected=>false,
:followers_count=>2100,
:friends_count=>2304,
:listed_count=>192,
:created_at=>"Wed Jul 15 12:02:35 +0000 2009",
:favourites_count=>2906,
:utc_offset=>32400,
:time_zone=>"Osaka",
:geo_enabled=>true,
:verified=>false,
:statuses_count=>166384,
:lang=>"en",
:contributors_enabled=>false,
:is_translator=>false,
:is_translation_enabled=>false,
:profile_background_color=>"48E0B7",
:profile_background_image_url=>
"http://pbs.twimg.com/profile_background_images/378800000158576090/WjPzbAXY.jpeg",
:profile_background_image_url_https=>
"https://pbs.twimg.com/profile_background_images/378800000158576090/WjPzbAXY.jpeg",
:profile_background_tile=>true,
:profile_image_url=>
"http://pbs.twimg.com/profile_images/3462273402/f331afb1b57c7d39688229e86de95881_normal.jpeg",
:profile_image_url_https=>
"https://pbs.twimg.com/profile_images/3462273402/f331afb1b57c7d39688229e86de95881_normal.jpeg",
:profile_banner_url=>
"https://pbs.twimg.com/profile_banners/56997313/1365179721",
:profile_link_color=>"009999",
:profile_sidebar_border_color=>"FFFFFF",
:profile_sidebar_fill_color=>"EFEFEF",
:profile_text_color=>"333333",
:profile_use_background_image=>true,
:default_profile=>false,
:default_profile_image=>false,
:following=>false,
:follow_request_sent=>false,
:notifications=>false},
:geo=>nil,
:coordinates=>nil,
:place=>nil,
:contributors=>nil,
:retweet_count=>0,
:favorite_count=>1,
:entities=>
{:hashtags=>[],
:symbols=>[],
:urls=>[],
:user_mentions=>[],
:media=>
[{:id=>449746301068926976,
:id_str=>"449746301068926976",
:indices=>[118, 140],
:media_url=>"http://pbs.twimg.com/media/Bj3R4MJCYAAqnMg.jpg",
:media_url_https=>"https://pbs.twimg.com/media/Bj3R4MJCYAAqnMg.jpg",
:url=>"http://t.co/Mljw3xOY3B",
:display_url=>"pic.twitter.com/Mljw3xOY3B",
:expanded_url=>
"http://twitter.com/riocampos/status/449746301857447936/photo/1",
:type=>"photo",
:sizes=>
{:medium=>{:w=>599, :h=>537, :resize=>"fit"},
:thumb=>{:w=>150, :h=>150, :resize=>"crop"},
:large=>{:w=>640, :h=>573, :resize=>"fit"},
:small=>{:w=>339, :h=>304, :resize=>"fit"}}}]},
:favorited=>false,
:retweeted=>false,
:possibly_sensitive=>false,
:lang=>"ja"}
…これも写真へのURL http://pbs.twimg.com/media/Bj3R4MJCYAAqnMg.jpg が1枚目にしか張られていない。
念のためOAuthでもみてみましょうか。
pp JSON.parse(response.body);
{"created_at"=>"Sat Mar 29 03:14:08 +0000 2014",
"id"=>449746301857447936,
"id_str"=>"449746301857447936",
"text"=>
"タグ付けされた側は通知が来る。そしてタグ付けを含むツイートには(ツイートした垢が鍵付きじゃなければ、タグ付けに関係しない垢からも)タグ付けされた垢名を確認できる。\n新機能の写真タグ付けに加え、写真は1ツイート4枚まで追加可能になった。 http://t.co/Mljw3xOY3B",
"source"=>
"<a href=\"http://twitter.com/download/iphone\" rel=\"nofollow\">Twitter for iPhone</a>",
"truncated"=>false,
"in_reply_to_status_id"=>nil,
"in_reply_to_status_id_str"=>nil,
"in_reply_to_user_id"=>nil,
"in_reply_to_user_id_str"=>nil,
"in_reply_to_screen_name"=>nil,
"user"=>
{"id"=>56997313,
"id_str"=>"56997313",
"name"=>"riocampos(りおかんぽす)",
"screen_name"=>"riocampos",
"location"=>"Osaka, Japan",
"description"=>
"plz call me rio☆ favorite: cycle road race & figure skate, Mac!, iPhone!, Ruby, Fine-Art, Science, Black/Green Tea. | Gender:♂ facebook: http://t.co/uP8O6PBYoU",
"url"=>"http://t.co/5yB3nIR3VQ",
"entities"=>
{"url"=>
{"urls"=>
[{"url"=>"http://t.co/5yB3nIR3VQ",
"expanded_url"=>"http://about.me/riocampos",
"display_url"=>"about.me/riocampos",
"indices"=>[0, 22]}]},
"description"=>
{"urls"=>
[{"url"=>"http://t.co/uP8O6PBYoU",
"expanded_url"=>"http://on.fb.me/MvEV7P",
"display_url"=>"on.fb.me/MvEV7P",
"indices"=>[137, 159]}]}},
"protected"=>false,
"followers_count"=>2100,
"friends_count"=>2304,
"listed_count"=>192,
"created_at"=>"Wed Jul 15 12:02:35 +0000 2009",
"favourites_count"=>2906,
"utc_offset"=>32400,
"time_zone"=>"Osaka",
"geo_enabled"=>true,
"verified"=>false,
"statuses_count"=>166389,
"lang"=>"en",
"contributors_enabled"=>false,
"is_translator"=>false,
"is_translation_enabled"=>false,
"profile_background_color"=>"48E0B7",
"profile_background_image_url"=>
"http://pbs.twimg.com/profile_background_images/378800000158576090/WjPzbAXY.jpeg",
"profile_background_image_url_https"=>
"https://pbs.twimg.com/profile_background_images/378800000158576090/WjPzbAXY.jpeg",
"profile_background_tile"=>true,
"profile_image_url"=>
"http://pbs.twimg.com/profile_images/3462273402/f331afb1b57c7d39688229e86de95881_normal.jpeg",
"profile_image_url_https"=>
"https://pbs.twimg.com/profile_images/3462273402/f331afb1b57c7d39688229e86de95881_normal.jpeg",
"profile_banner_url"=>
"https://pbs.twimg.com/profile_banners/56997313/1365179721",
"profile_link_color"=>"009999",
"profile_sidebar_border_color"=>"FFFFFF",
"profile_sidebar_fill_color"=>"EFEFEF",
"profile_text_color"=>"333333",
"profile_use_background_image"=>true,
"default_profile"=>false,
"default_profile_image"=>false,
"following"=>false,
"follow_request_sent"=>false,
"notifications"=>false},
"geo"=>nil,
"coordinates"=>nil,
"place"=>nil,
"contributors"=>nil,
"retweet_count"=>0,
"favorite_count"=>1,
"entities"=>
{"hashtags"=>[],
"symbols"=>[],
"urls"=>[],
"user_mentions"=>[],
"media"=>
[{"id"=>449746301068926976,
"id_str"=>"449746301068926976",
"indices"=>[118, 140],
"media_url"=>"http://pbs.twimg.com/media/Bj3R4MJCYAAqnMg.jpg",
"media_url_https"=>"https://pbs.twimg.com/media/Bj3R4MJCYAAqnMg.jpg",
"url"=>"http://t.co/Mljw3xOY3B",
"display_url"=>"pic.twitter.com/Mljw3xOY3B",
"expanded_url"=>
"http://twitter.com/riocampos/status/449746301857447936/photo/1",
"type"=>"photo",
"sizes"=>
{"medium"=>{"w"=>599, "h"=>537, "resize"=>"fit"},
"thumb"=>{"w"=>150, "h"=>150, "resize"=>"crop"},
"large"=>{"w"=>640, "h"=>573, "resize"=>"fit"},
"small"=>{"w"=>339, "h"=>304, "resize"=>"fit"}}}]},
"favorited"=>false,
"retweeted"=>false,
"possibly_sensitive"=>false,
"lang"=>"ja"}
…やっぱ同じか。
API拡張してほしいなぁ。
Twitter上の会話をより楽しみやすくするため、写真関連の機能を2つ追加しました。写真に写っている人にタグを付けたり、ツイートに最大4枚の写真を添付できるようになりました。
写真でもっと楽しみませんか
その1:タグ付け
タグ付けテスト pic.twitter.com/SuCOMQdIWt
— riocampos5 (@riocampos5) March 29, 2014
このツイートをAPIで見てみます。Twitter gem(5.7.1ただし現時点の最新は5.8.0)を使いました。
{:created_at=>"Sat Mar 29 02:58:22 +0000 2014", :id=>449742330350682112, :id_str=>"449742330350682112", :text=>"タグ付けテスト http://t.co/SuCOMQdIWt", :source=> "<a href=\"http://twitter.com/download/iphone\" rel=\"nofollow\">Twitter for iPhone</a>", :truncated=>false, :in_reply_to_status_id=>nil, :in_reply_to_status_id_str=>nil, :in_reply_to_user_id=>nil, :in_reply_to_user_id_str=>nil, :in_reply_to_screen_name=>nil, :user=> {:id=>709067502, :id_str=>"709067502", :name=>"riocampos5", :screen_name=>"riocampos5", :location=>"", :description=>"", :url=>nil, :entities=>{:description=>{:urls=>[]}}, :protected=>false, :followers_count=>1, :friends_count=>1, :listed_count=>1, :created_at=>"Sat Jul 21 14:32:44 +0000 2012", :favourites_count=>0, :utc_offset=>nil, :time_zone=>nil, :geo_enabled=>false, :verified=>false, :statuses_count=>285, :lang=>"ja", :contributors_enabled=>false, :is_translator=>false, :is_translation_enabled=>false, :profile_background_color=>"C0DEED", :profile_background_image_url=> "http://abs.twimg.com/images/themes/theme1/bg.png", :profile_background_image_url_https=> "https://abs.twimg.com/images/themes/theme1/bg.png", :profile_background_tile=>false, :profile_image_url=> "http://abs.twimg.com/sticky/default_profile_images/default_profile_3_normal.png", :profile_image_url_https=> "https://abs.twimg.com/sticky/default_profile_images/default_profile_3_normal.png", :profile_link_color=>"0084B4", :profile_sidebar_border_color=>"C0DEED", :profile_sidebar_fill_color=>"DDEEF6", :profile_text_color=>"333333", :profile_use_background_image=>true, :default_profile=>true, :default_profile_image=>true, :following=>true, :follow_request_sent=>false, :notifications=>false}, :geo=>nil, :coordinates=>nil, :place=>nil, :contributors=>nil, :retweet_count=>0, :favorite_count=>0, :entities=> {:hashtags=>[], :symbols=>[], :urls=>[], :user_mentions=>[], :media=> [{:id=>449742329474072576, :id_str=>"449742329474072576", :indices=>[8, 30], :media_url=>"http://pbs.twimg.com/media/Bj3ORAzCQAAjy2i.jpg", :media_url_https=>"https://pbs.twimg.com/media/Bj3ORAzCQAAjy2i.jpg", :url=>"http://t.co/SuCOMQdIWt", :display_url=>"pic.twitter.com/SuCOMQdIWt", :expanded_url=> "http://twitter.com/riocampos5/status/449742330350682112/photo/1", :type=>"photo", :sizes=> {:large=>{:w=>533, :h=>533, :resize=>"fit"}, :thumb=>{:w=>150, :h=>150, :resize=>"crop"}, :medium=>{:w=>533, :h=>533, :resize=>"fit"}, :small=>{:w=>340, :h=>340, :resize=>"fit"}}}]}, :favorited=>false, :retweeted=>false, :possibly_sensitive=>false, :lang=>"ja"}
…:mediaのなかに入ってるかと思いましたが入ってませんね。
ではTwitter gemを使わずOAuthを使って直接確認します。
毎度ですが、key/secretはニセモノです。
#!/usr/bin/env ruby # coding: utf-8 require 'twitter' require 'oauth' key_secret = { consumer_key: '9Gu1FiE1IfKi32bR8Fw', consumer_secret: 'QUnRDVcl5FNCZ9C1j80OAjUJlguMNVyqbdrOrnjtQ', access_token: '2194235326-sm2SUkVRHMJ1CdwYG1f04klQMlxc4i05tkSbnZa', access_token_secret: 'oairK8FMvLZ8dqEVrCgh2brhyL0SCd5wpdkIoNxz62Jdi', } # Exchange your oauth_token and oauth_token_secret for an AccessToken instance. def prepare_access_token(key_secret) consumer = OAuth::Consumer.new( key_secret[:consumer_key], key_secret[:consumer_secret], { site: "https://api.twitter.com", scheme: :header } ) # now create the access token object from passed values token_hash = { oauth_token: key_secret[:access_token], oauth_token_secret: key_secret[:access_token_secret] } OAuth::AccessToken.from_hash(consumer, token_hash) end # Exchange our oauth_token and oauth_token secret for the AccessToken instance. access_token = prepare_access_token(key_secret) # use the access token as an agent to get the home timeline response = access_token.request(:get, "https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=riocampos5&count=1")
これをpryで実行して、返ってきたのがこちら。
pry(main)> pp JSON.parse(response.body); [{"created_at"=>"Sat Mar 29 02:58:22 +0000 2014", "id"=>449742330350682112, "id_str"=>"449742330350682112", "text"=>"タグ付けテスト http://t.co/SuCOMQdIWt", "source"=> "<a href=\"http://twitter.com/download/iphone\" rel=\"nofollow\">Twitter for iPhone</a>", "truncated"=>false, "in_reply_to_status_id"=>nil, "in_reply_to_status_id_str"=>nil, "in_reply_to_user_id"=>nil, "in_reply_to_user_id_str"=>nil, "in_reply_to_screen_name"=>nil, "user"=> {"id"=>709067502, "id_str"=>"709067502", "name"=>"riocampos5", "screen_name"=>"riocampos5", "location"=>"", "description"=>"", "url"=>nil, "entities"=>{"description"=>{"urls"=>[]}}, "protected"=>false, "followers_count"=>1, "friends_count"=>1, "listed_count"=>1, "created_at"=>"Sat Jul 21 14:32:44 +0000 2012", "favourites_count"=>0, "utc_offset"=>nil, "time_zone"=>nil, "geo_enabled"=>false, "verified"=>false, "statuses_count"=>285, "lang"=>"ja", "contributors_enabled"=>false, "is_translator"=>false, "is_translation_enabled"=>false, "profile_background_color"=>"C0DEED", "profile_background_image_url"=> "http://abs.twimg.com/images/themes/theme1/bg.png", "profile_background_image_url_https"=> "https://abs.twimg.com/images/themes/theme1/bg.png", "profile_background_tile"=>false, "profile_image_url"=> "http://abs.twimg.com/sticky/default_profile_images/default_profile_3_normal.png", "profile_image_url_https"=> "https://abs.twimg.com/sticky/default_profile_images/default_profile_3_normal.png", "profile_link_color"=>"0084B4", "profile_sidebar_border_color"=>"C0DEED", "profile_sidebar_fill_color"=>"DDEEF6", "profile_text_color"=>"333333", "profile_use_background_image"=>true, "default_profile"=>true, "default_profile_image"=>true, "following"=>true, "follow_request_sent"=>false, "notifications"=>false}, "geo"=>nil, "coordinates"=>nil, "place"=>nil, "contributors"=>nil, "retweet_count"=>0, "favorite_count"=>0, "entities"=> {"hashtags"=>[], "symbols"=>[], "urls"=>[], "user_mentions"=>[], "media"=> [{"id"=>449742329474072576, "id_str"=>"449742329474072576", "indices"=>[8, 30], "media_url"=>"http://pbs.twimg.com/media/Bj3ORAzCQAAjy2i.jpg", "media_url_https"=>"https://pbs.twimg.com/media/Bj3ORAzCQAAjy2i.jpg", "url"=>"http://t.co/SuCOMQdIWt", "display_url"=>"pic.twitter.com/SuCOMQdIWt", "expanded_url"=> "http://twitter.com/riocampos5/status/449742330350682112/photo/1", "type"=>"photo", "sizes"=> {"large"=>{"w"=>533, "h"=>533, "resize"=>"fit"}, "thumb"=>{"w"=>150, "h"=>150, "resize"=>"crop"}, "medium"=>{"w"=>533, "h"=>533, "resize"=>"fit"}, "small"=>{"w"=>340, "h"=>340, "resize"=>"fit"}}}]}, "favorited"=>false, "retweeted"=>false, "possibly_sensitive"=>false, "lang"=>"ja"}]
…Twitter gemでの返値と全く一緒です。
結局、APIでのアクセスでは、写真のタグ付け情報が含まれていませんでしたorz
その2:写真複数添付
タグ付けされた側は通知が来る。そしてタグ付けを含むツイートには(ツイートした垢が鍵付きじゃなければ、タグ付けに関係しない垢からも)タグ付けされた垢名を確認できる。
新機能の写真タグ付けに加え、写真は1ツイート4枚まで追加可能になった。 pic.twitter.com/Mljw3xOY3B
— riocampos(りおかんぽす) (@riocampos) March 29, 2014
{:created_at=>"Sat Mar 29 03:14:08 +0000 2014", :id=>449746301857447936, :id_str=>"449746301857447936", :text=> "タグ付けされた側は通知が来る。そしてタグ付けを含むツイートには(ツイートした垢が鍵付きじゃなければ、タグ付けに関係しない垢からも)タグ付けされた垢名を確認できる。\n新機能の写真タグ付けに加え、写真は1ツイート4枚まで追加可能になった。 http://t.co/Mljw3xOY3B", :source=> "<a href=\"http://twitter.com/download/iphone\" rel=\"nofollow\">Twitter for iPhone</a>", :truncated=>false, :in_reply_to_status_id=>nil, :in_reply_to_status_id_str=>nil, :in_reply_to_user_id=>nil, :in_reply_to_user_id_str=>nil, :in_reply_to_screen_name=>nil, :user=> {:id=>56997313, :id_str=>"56997313", :name=>"riocampos(りおかんぽす)", :screen_name=>"riocampos", :location=>"Osaka, Japan", :description=> "plz call me rio☆ favorite: cycle road race & figure skate, Mac!, iPhone!, Ruby, Fine-Art, Science, Black/Green Tea. | Gender:♂ facebook: http://t.co/uP8O6PBYoU", :url=>"http://t.co/5yB3nIR3VQ", :entities=> {:url=> {:urls=> [{:url=>"http://t.co/5yB3nIR3VQ", :expanded_url=>"http://about.me/riocampos", :display_url=>"about.me/riocampos", :indices=>[0, 22]}]}, :description=> {:urls=> [{:url=>"http://t.co/uP8O6PBYoU", :expanded_url=>"http://on.fb.me/MvEV7P", :display_url=>"on.fb.me/MvEV7P", :indices=>[137, 159]}]}}, :protected=>false, :followers_count=>2100, :friends_count=>2304, :listed_count=>192, :created_at=>"Wed Jul 15 12:02:35 +0000 2009", :favourites_count=>2906, :utc_offset=>32400, :time_zone=>"Osaka", :geo_enabled=>true, :verified=>false, :statuses_count=>166384, :lang=>"en", :contributors_enabled=>false, :is_translator=>false, :is_translation_enabled=>false, :profile_background_color=>"48E0B7", :profile_background_image_url=> "http://pbs.twimg.com/profile_background_images/378800000158576090/WjPzbAXY.jpeg", :profile_background_image_url_https=> "https://pbs.twimg.com/profile_background_images/378800000158576090/WjPzbAXY.jpeg", :profile_background_tile=>true, :profile_image_url=> "http://pbs.twimg.com/profile_images/3462273402/f331afb1b57c7d39688229e86de95881_normal.jpeg", :profile_image_url_https=> "https://pbs.twimg.com/profile_images/3462273402/f331afb1b57c7d39688229e86de95881_normal.jpeg", :profile_banner_url=> "https://pbs.twimg.com/profile_banners/56997313/1365179721", :profile_link_color=>"009999", :profile_sidebar_border_color=>"FFFFFF", :profile_sidebar_fill_color=>"EFEFEF", :profile_text_color=>"333333", :profile_use_background_image=>true, :default_profile=>false, :default_profile_image=>false, :following=>false, :follow_request_sent=>false, :notifications=>false}, :geo=>nil, :coordinates=>nil, :place=>nil, :contributors=>nil, :retweet_count=>0, :favorite_count=>1, :entities=> {:hashtags=>[], :symbols=>[], :urls=>[], :user_mentions=>[], :media=> [{:id=>449746301068926976, :id_str=>"449746301068926976", :indices=>[118, 140], :media_url=>"http://pbs.twimg.com/media/Bj3R4MJCYAAqnMg.jpg", :media_url_https=>"https://pbs.twimg.com/media/Bj3R4MJCYAAqnMg.jpg", :url=>"http://t.co/Mljw3xOY3B", :display_url=>"pic.twitter.com/Mljw3xOY3B", :expanded_url=> "http://twitter.com/riocampos/status/449746301857447936/photo/1", :type=>"photo", :sizes=> {:medium=>{:w=>599, :h=>537, :resize=>"fit"}, :thumb=>{:w=>150, :h=>150, :resize=>"crop"}, :large=>{:w=>640, :h=>573, :resize=>"fit"}, :small=>{:w=>339, :h=>304, :resize=>"fit"}}}]}, :favorited=>false, :retweeted=>false, :possibly_sensitive=>false, :lang=>"ja"}
…これも写真へのURL http://pbs.twimg.com/media/Bj3R4MJCYAAqnMg.jpg が1枚目にしか張られていない。
念のためOAuthでもみてみましょうか。
pp JSON.parse(response.body); {"created_at"=>"Sat Mar 29 03:14:08 +0000 2014", "id"=>449746301857447936, "id_str"=>"449746301857447936", "text"=> "タグ付けされた側は通知が来る。そしてタグ付けを含むツイートには(ツイートした垢が鍵付きじゃなければ、タグ付けに関係しない垢からも)タグ付けされた垢名を確認できる。\n新機能の写真タグ付けに加え、写真は1ツイート4枚まで追加可能になった。 http://t.co/Mljw3xOY3B", "source"=> "<a href=\"http://twitter.com/download/iphone\" rel=\"nofollow\">Twitter for iPhone</a>", "truncated"=>false, "in_reply_to_status_id"=>nil, "in_reply_to_status_id_str"=>nil, "in_reply_to_user_id"=>nil, "in_reply_to_user_id_str"=>nil, "in_reply_to_screen_name"=>nil, "user"=> {"id"=>56997313, "id_str"=>"56997313", "name"=>"riocampos(りおかんぽす)", "screen_name"=>"riocampos", "location"=>"Osaka, Japan", "description"=> "plz call me rio☆ favorite: cycle road race & figure skate, Mac!, iPhone!, Ruby, Fine-Art, Science, Black/Green Tea. | Gender:♂ facebook: http://t.co/uP8O6PBYoU", "url"=>"http://t.co/5yB3nIR3VQ", "entities"=> {"url"=> {"urls"=> [{"url"=>"http://t.co/5yB3nIR3VQ", "expanded_url"=>"http://about.me/riocampos", "display_url"=>"about.me/riocampos", "indices"=>[0, 22]}]}, "description"=> {"urls"=> [{"url"=>"http://t.co/uP8O6PBYoU", "expanded_url"=>"http://on.fb.me/MvEV7P", "display_url"=>"on.fb.me/MvEV7P", "indices"=>[137, 159]}]}}, "protected"=>false, "followers_count"=>2100, "friends_count"=>2304, "listed_count"=>192, "created_at"=>"Wed Jul 15 12:02:35 +0000 2009", "favourites_count"=>2906, "utc_offset"=>32400, "time_zone"=>"Osaka", "geo_enabled"=>true, "verified"=>false, "statuses_count"=>166389, "lang"=>"en", "contributors_enabled"=>false, "is_translator"=>false, "is_translation_enabled"=>false, "profile_background_color"=>"48E0B7", "profile_background_image_url"=> "http://pbs.twimg.com/profile_background_images/378800000158576090/WjPzbAXY.jpeg", "profile_background_image_url_https"=> "https://pbs.twimg.com/profile_background_images/378800000158576090/WjPzbAXY.jpeg", "profile_background_tile"=>true, "profile_image_url"=> "http://pbs.twimg.com/profile_images/3462273402/f331afb1b57c7d39688229e86de95881_normal.jpeg", "profile_image_url_https"=> "https://pbs.twimg.com/profile_images/3462273402/f331afb1b57c7d39688229e86de95881_normal.jpeg", "profile_banner_url"=> "https://pbs.twimg.com/profile_banners/56997313/1365179721", "profile_link_color"=>"009999", "profile_sidebar_border_color"=>"FFFFFF", "profile_sidebar_fill_color"=>"EFEFEF", "profile_text_color"=>"333333", "profile_use_background_image"=>true, "default_profile"=>false, "default_profile_image"=>false, "following"=>false, "follow_request_sent"=>false, "notifications"=>false}, "geo"=>nil, "coordinates"=>nil, "place"=>nil, "contributors"=>nil, "retweet_count"=>0, "favorite_count"=>1, "entities"=> {"hashtags"=>[], "symbols"=>[], "urls"=>[], "user_mentions"=>[], "media"=> [{"id"=>449746301068926976, "id_str"=>"449746301068926976", "indices"=>[118, 140], "media_url"=>"http://pbs.twimg.com/media/Bj3R4MJCYAAqnMg.jpg", "media_url_https"=>"https://pbs.twimg.com/media/Bj3R4MJCYAAqnMg.jpg", "url"=>"http://t.co/Mljw3xOY3B", "display_url"=>"pic.twitter.com/Mljw3xOY3B", "expanded_url"=> "http://twitter.com/riocampos/status/449746301857447936/photo/1", "type"=>"photo", "sizes"=> {"medium"=>{"w"=>599, "h"=>537, "resize"=>"fit"}, "thumb"=>{"w"=>150, "h"=>150, "resize"=>"crop"}, "large"=>{"w"=>640, "h"=>573, "resize"=>"fit"}, "small"=>{"w"=>339, "h"=>304, "resize"=>"fit"}}}]}, "favorited"=>false, "retweeted"=>false, "possibly_sensitive"=>false, "lang"=>"ja"}
…やっぱ同じか。
API拡張してほしいなぁ。