* Twitter APIで取得した際のデータ構造 [#z76a5d09]
APIバージョンで多少異なると思いますが、2012年9月に公開されたAPI 1.1で取得してみました。~
ユーザータイムライン(自分の発言)を取得したときの結果をもとにしました。
探してないけど、英語の一次ドキュメントってあるのかな?
*** ツイート(Status) [#pe22e038]
|パラメータ |内容 |h
|~contributors | |
|~coordinates | |
|~created_at |作成日時(UTC) |
|~entities |付加情報(hashtags, urls, user_mentions)|
|~favorited |(自分が)お気に入りにしたか? |
|~geo | |
|~id |ツイートID(数値型) |
|~id_str |ツイートID(文字列型) |
|~in_reply_to_screen_name |返信先ユーザー名 |
|~in_reply_to_status_id |返信先ツイートID(数値型) |
|~in_reply_to_status_id_str|返信先ツイートID(文字列型) |
|~in_reply_to_user_id |返信先ユーザーID(数値型) |
|~in_reply_to_user_id_str |返信先ユーザーID(文字列型) |
|~place | |
|~possibly_sensitive |不適切なコンテンツフラグ(※1)|
|~possibly_sensitive |不適切なコンテンツフラグ((リンクがあるときのみ))|
|~retweet_count |RTされた数 |
|~retweeted | |
|~retweeted_status |RTしたツイートオブジェクト(※2)|
|~retweeted_status |RTしたツイートオブジェクト((RTの場合のみ))|
|~source |ツイートしたソース |
|~text |ツイート内容 |
|~truncated | |
|~user |ツイートしたユーザーオブジェクト|
** ツイートのエンティティ [#e54c2abf]
エンティティ(Entities)には現時点(API 1.1)でhashtags、urlsおよびuser_mentionsが含まれている。ツイートを解析した内容が入っているようだ。
|パラメータ |内容 |h
|~hashtags |ハッシュタグオブジェクトの配列 |
|~urls |URLオブジェクトの配列 |
|~user_mentions|ユーザーメンションオブジェクトの配列|
** ハッシュタグ [#t1c8c43f]
|パラメータ |内容|h
|~indices |テキスト中の出現位置|
|~text |タグ名|
** URL [#ra0f9a06]
|パラメータ |内容|h
|~url |テキスト中に示されたリンク先URL |
|~indices |テキスト中の出現位置 |
|~expanded_url |短縮URL展開後のURL |
|~display_url |表示されるURL((ユーザーオブジェクト中では存在しない))|
** ユーザーメンション [#x9ee0ed3]
|パラメータ |内容 |値の例|h
|~id |ユーザーID(数値型) | |
|~id_str |ユーザーID(文字列型)| |
|~indices |テキスト中の出現位置|[97,104]|
|~screen_name |ユーザー名 |dobuo |
|~name |ユーザーの名前 |どぶお |
** ユーザー [#u243619e]
|パラメータ |内容 |値の例|h
|~contributors_enabled | ||
|~created_at |ユーザーの作成日時(UTC) ||
|~default_profile |ディフォルトプロフィールか? |False|
|~default_profile_image |ディフォルトイメージか? |False|
|~description |ユーザー自己紹介 ||
|~entities |付加情報(description, url) ||
|~favorites_count |お気に入りの数 ||
|~follow_request_sent |(自分が)フォローリクエストをしているか||
|~followers_count |フォローされている数 ||
|~following |(自分が)フォローしているか ||
|~friends_count |フォローしている数 ||
|~geo_enabled |位置情報の設定 ||
|~id |ユーザーID(数値型) ||
|~id_str |ユーザーID(文字列型) ||
|~is_translator |翻訳者登録しているか |False|
|~lang |言語 |ja|
|~listed_count |リストされている数 ||
|~location |場所 |東京|
|~name |名前 ||
|~notifications | |False|
|~profile_background_color |背景色 ||
|~profile_background_image_url |背景画像URL ||
|~profile_background_image_url_https|背景画像URL(https) ||
|~profile_background_tile |背景をタイルするか ||
|~profile_image_url |プロフィール画像URL ||
|~profile_image_url_https |プロフィール画像URL(https) ||
|~profile_link_color |リンク色 ||
|~profile_sidebar_border_color |サイドバー境界色 ||
|~profile_sidebar_fill_color |サイドバーの色 ||
|~profile_text_color |文字色 ||
|~profile_use_background_image |背景画像を使っているか ||
|~protected |ツイートは非公開か |False|
|~screen_name |ユーザー名 |dobuo|
|~show_all_inline_media | |False|
|~status_count |ツイート数 ||
|~time_zone |タイムゾーン名 |Tokyo|
|~url |プロフィールURL |http://biokids.org/|
|~utc_offset |UTCからのオフセット秒 |32400|
|~verified |認証済みアカウントか ||