LoginSignup
1
1

More than 1 year has passed since last update.

#Twitter #API で1個のツイートIDを指定すると、ツリーの最上段までたどって全ツイートを取得する #python スクリプトの例 ( + #jq )

Last updated at Posted at 2019-04-02
  • Twitterのツイート同士はツリー構造なので、ツイートがチェーンしている場合、下から上にむかって順々にたどることが出来る

追記

これで full_text が得られるみたいです

 api_parameter = {
   "id": last_tweet['in_reply_to_status_id_str'] if last_tweet and last_tweet['in_reply_to_status_id_str'] else tweet_id,
   "tweet_mode" : "extended"
 }

config.py

CONSUMER_KEY = ''
CONSUMER_SECRET = ''
ACCESS_TOKEN = ''
ACCESS_TOKEN_SECRET = ''

script

#!/usr/bin/env python3

# https://developer.twitter.com/en/docs/tweets/post-and-engage/api-reference/get-statuses-show-id
# https://twitter.com/YumaInaura/status/1112838809991798784

import json, config, os, re
from requests_oauthlib import OAuth1Session

if os.environ.get('TWITTER_CONSUMER_KEY'):
  CONSUMER_KEY = os.environ.get('TWITTER_CONSUMER_KEY')
  CONSUMER_SECRET = os.environ.get('TWITTER_CONSUMER_SECRET')
  ACCESS_TOKEN = os.environ.get('TWITTER_ACCESS_TOKEN')
  ACCESS_TOKEN_SECRET = os.environ.get('TWITTER_ACCESS_TOKEN_SECRET')
else:
  CONSUMER_KEY = config.CONSUMER_KEY
  CONSUMER_SECRET = config.CONSUMER_SECRET
  ACCESS_TOKEN = config.ACCESS_TOKEN
  ACCESS_TOKEN_SECRET = config.ACCESS_TOKEN_SECRET

twitter = OAuth1Session(CONSUMER_KEY, CONSUMER_SECRET, ACCESS_TOKEN, ACCESS_TOKEN_SECRET)

last_tweet = {}
tweets = []

MAX_ROUND = int(os.environ.get('ROUND')) if os.environ.get('ROUND') else 30

for i in range(1, MAX_ROUND+1):
  api_parameter = {
    "id": last_tweet['in_reply_to_status_id_str'] if last_tweet and last_tweet['in_reply_to_status_id_str'] else os.environ.get('ID'),
  }
  
  api_url = "https://api.twitter.com/1.1/statuses/show.json"
 
  response = twitter.get(api_url, params=api_parameter)
  tweet = last_tweet = response.json()

  if not tweet['in_reply_to_status_id_str']:
    break
  else:
    tweets.append(tweet)

print(json.dumps(tweets))

e.g

ID=1112838809991798784 ./show-chain.py | tee chain.log | jq

[
  {
    "created_at": "Mon Apr 01 22:07:02 +0000 2019",
    "id": 1112838809991798800,
    "id_str": "1112838809991798784",
    "text": "転職ドラフトの前回 第17回のユーザーランキングを見ると、年収提示ランキングの最高額が1100万円であり、累計平均が最高のユーザーは975万円のようだ。これだけ有名なサービスでの、有象無象のエンジニアのトップがこれであると考えると… https://t.co/veQb92SbHo",
    "truncated": true,
    "entities": {
      "hashtags": [],
      "symbols": [],
      "user_mentions": [],
      "urls": [
        {
          "url": "https://t.co/veQb92SbHo",
          "expanded_url": "https://twitter.com/i/web/status/1112838809991798784",
          "display_url": "twitter.com/i/web/status/1…",
          "indices": [
            117,
            140
          ]
        }
      ]
    },
    "source": "<a href=\"https://mobile.twitter.com\" rel=\"nofollow\">Twitter Web App</a>",
    "in_reply_to_status_id": 1112837955121438700,
    "in_reply_to_status_id_str": "1112837955121438720",
    "in_reply_to_user_id": 473780756,
    "in_reply_to_user_id_str": "473780756",
    "in_reply_to_screen_name": "YumaInaura",
    "user": {
      "id": 473780756,
      "id_str": "473780756",
      "name": "0",
      "screen_name": "YumaInaura",
      "location": "",
      "description": "",
      "url": "https://t.co/8PZWB3UTuq",
      "entities": {
        "url": {
          "urls": [
            {
              "url": "https://t.co/8PZWB3UTuq",
              "expanded_url": "https://www.instagram.com/yumainaura/",
              "display_url": "instagram.com/yumainaura/",
              "indices": [
                0,
                23
              ]
            }
          ]
        },
        "description": {
          "urls": []
        }
      },
      "protected": false,
      "followers_count": 539,
      "friends_count": 0,
      "listed_count": 28,
      "created_at": "Wed Jan 25 09:59:57 +0000 2012",
      "favourites_count": 25059,
      "utc_offset": null,
      "time_zone": null,
      "geo_enabled": true,
      "verified": false,
      "statuses_count": 37617,
      "lang": "en",
      "contributors_enabled": false,
      "is_translator": false,
      "is_translation_enabled": false,
      "profile_background_color": "000000",
      "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://pbs.twimg.com/profile_images/1110446096596127744/wI7-uC6I_normal.jpg",
      "profile_image_url_https": "https://pbs.twimg.com/profile_images/1110446096596127744/wI7-uC6I_normal.jpg",
      "profile_banner_url": "https://pbs.twimg.com/profile_banners/473780756/1552991452",
      "profile_link_color": "1B95E0",
      "profile_sidebar_border_color": "000000",
      "profile_sidebar_fill_color": "000000",
      "profile_text_color": "000000",
      "profile_use_background_image": false,
      "has_extended_profile": false,
      "default_profile": false,
      "default_profile_image": false,
      "following": false,
      "follow_request_sent": false,
      "notifications": false,
      "translator_type": "none"
    },
    "geo": null,
    "coordinates": null,
    "place": null,
    "contributors": null,
    "is_quote_status": false,
    "retweet_count": 0,
    "favorite_count": 0,
    "favorited": false,
    "retweeted": false,
    "possibly_sensitive": false,
    "possibly_sensitive_appealable": false,
    "lang": "ja"
  },
  {
    "created_at": "Mon Apr 01 22:03:38 +0000 2019",
    "id": 1112837955121438700,
    "id_str": "1112837955121438720",
    "text": "転職ドラフトはエントリー期間対象外であった。こういう時に妙な罪悪感を持ち出して、もっと早く見ておけば良かったとか、動くのがおそすぎたのだと、自分を刃物で突き刺すのは愚策である。結果はあくまで結果論であり、過去の愛すべき自分だって、最善を尽くしたであろうから。#i",
    "truncated": false,
    "entities": {
      "hashtags": [
        {
          "text": "i",
          "indices": [
            129,
            131
          ]
        }
      ],
      "symbols": [],
      "user_mentions": [],
      "urls": []
    },
    "source": "<a href=\"https://mobile.twitter.com\" rel=\"nofollow\">Twitter Web App</a>",
    "in_reply_to_status_id": 1112837456577978400,
    "in_reply_to_status_id_str": "1112837456577978369",
    "in_reply_to_user_id": 473780756,
    "in_reply_to_user_id_str": "473780756",
    "in_reply_to_screen_name": "YumaInaura",
    "user": {
      "id": 473780756,
      "id_str": "473780756",
      "name": "0",
      "screen_name": "YumaInaura",
      "location": "",
      "description": "",
      "url": "https://t.co/8PZWB3UTuq",
      "entities": {
        "url": {
          "urls": [
            {
              "url": "https://t.co/8PZWB3UTuq",
              "expanded_url": "https://www.instagram.com/yumainaura/",
              "display_url": "instagram.com/yumainaura/",
              "indices": [
                0,
                23
              ]
            }
          ]
        },
        "description": {
          "urls": []
        }
      },
      "protected": false,
      "followers_count": 539,
      "friends_count": 0,
      "listed_count": 28,
      "created_at": "Wed Jan 25 09:59:57 +0000 2012",
      "favourites_count": 25059,
      "utc_offset": null,
      "time_zone": null,
      "geo_enabled": true,
      "verified": false,
      "statuses_count": 37617,
      "lang": "en",
      "contributors_enabled": false,
      "is_translator": false,
      "is_translation_enabled": false,
      "profile_background_color": "000000",
      "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://pbs.twimg.com/profile_images/1110446096596127744/wI7-uC6I_normal.jpg",
      "profile_image_url_https": "https://pbs.twimg.com/profile_images/1110446096596127744/wI7-uC6I_normal.jpg",
      "profile_banner_url": "https://pbs.twimg.com/profile_banners/473780756/1552991452",
      "profile_link_color": "1B95E0",
      "profile_sidebar_border_color": "000000",
      "profile_sidebar_fill_color": "000000",
      "profile_text_color": "000000",
      "profile_use_background_image": false,
      "has_extended_profile": false,
      "default_profile": false,
      "default_profile_image": false,
      "following": false,
      "follow_request_sent": false,
      "notifications": false,
      "translator_type": "none"
    },
    "geo": null,
    "coordinates": null,
    "place": null,
    "contributors": null,
    "is_quote_status": false,
    "retweet_count": 0,
    "favorite_count": 0,
    "favorited": false,
    "retweeted": false,
    "lang": "ja"
  },
  {
    "created_at": "Mon Apr 01 22:01:39 +0000 2019",
    "id": 1112837456577978400,
    "id_str": "1112837456577978369",
    "text": "転職ドラフトという名前だけあって、期間が区切られてエントリーを受け付ける形式のようだ。ところで開催月は奇数月らしく、早速も、既に4月2日の今はエントリーが出来ぬことに気づく。次回は5月の開催。結果発表はそれよりも遅くなると考えると… https://t.co/FUBLhWk2mh",
    "truncated": true,
    "entities": {
      "hashtags": [],
      "symbols": [],
      "user_mentions": [],
      "urls": [
        {
          "url": "https://t.co/FUBLhWk2mh",
          "expanded_url": "https://twitter.com/i/web/status/1112837456577978369",
          "display_url": "twitter.com/i/web/status/1…",
          "indices": [
            117,
            140
          ]
        }
      ]
    },
    "source": "<a href=\"https://mobile.twitter.com\" rel=\"nofollow\">Twitter Web App</a>",
    "in_reply_to_status_id": 1112835847680749600,
    "in_reply_to_status_id_str": "1112835847680749568",
    "in_reply_to_user_id": 473780756,
    "in_reply_to_user_id_str": "473780756",
    "in_reply_to_screen_name": "YumaInaura",
    "user": {
      "id": 473780756,
      "id_str": "473780756",
      "name": "0",
      "screen_name": "YumaInaura",
      "location": "",
      "description": "",
      "url": "https://t.co/8PZWB3UTuq",
      "entities": {
        "url": {
          "urls": [
            {
              "url": "https://t.co/8PZWB3UTuq",
              "expanded_url": "https://www.instagram.com/yumainaura/",
              "display_url": "instagram.com/yumainaura/",
              "indices": [
                0,
                23
              ]
            }
          ]
        },
        "description": {
          "urls": []
        }
      },
      "protected": false,
      "followers_count": 539,
      "friends_count": 0,
      "listed_count": 28,
      "created_at": "Wed Jan 25 09:59:57 +0000 2012",
      "favourites_count": 25059,
      "utc_offset": null,
      "time_zone": null,
      "geo_enabled": true,
      "verified": false,
      "statuses_count": 37617,
      "lang": "en",
      "contributors_enabled": false,
      "is_translator": false,
      "is_translation_enabled": false,
      "profile_background_color": "000000",
      "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://pbs.twimg.com/profile_images/1110446096596127744/wI7-uC6I_normal.jpg",
      "profile_image_url_https": "https://pbs.twimg.com/profile_images/1110446096596127744/wI7-uC6I_normal.jpg",
      "profile_banner_url": "https://pbs.twimg.com/profile_banners/473780756/1552991452",
      "profile_link_color": "1B95E0",
      "profile_sidebar_border_color": "000000",
      "profile_sidebar_fill_color": "000000",
      "profile_text_color": "000000",
      "profile_use_background_image": false,
      "has_extended_profile": false,
      "default_profile": false,
      "default_profile_image": false,
      "following": false,
      "follow_request_sent": false,
      "notifications": false,
      "translator_type": "none"
    },
    "geo": null,
    "coordinates": null,
    "place": null,
    "contributors": null,
    "is_quote_status": false,
    "retweet_count": 0,
    "favorite_count": 0,
    "favorited": false,
    "retweeted": false,
    "possibly_sensitive": false,
    "possibly_sensitive_appealable": false,
    "lang": "ja"
  },
  {
    "created_at": "Mon Apr 01 21:55:16 +0000 2019",
    "id": 1112835847680749600,
    "id_str": "1112835847680749568",
    "text": "Qiitaなどの記事を一本書くことのコストというのは莫大である。なぜか。Twitterでないからだ。巨大なテキストの編集コストというものは、巨大に跳ね上がるように出来ている。しかしTwitterのように小さい粒のまとまりをスタック… https://t.co/M12LalFzrt",
    "truncated": true,
    "entities": {
      "hashtags": [],
      "symbols": [],
      "user_mentions": [],
      "urls": [
        {
          "url": "https://t.co/M12LalFzrt",
          "expanded_url": "https://twitter.com/i/web/status/1112835847680749568",
          "display_url": "twitter.com/i/web/status/1…",
          "indices": [
            117,
            140
          ]
        }
      ]
    },
    "source": "<a href=\"https://mobile.twitter.com\" rel=\"nofollow\">Twitter Web App</a>",
    "in_reply_to_status_id": 1112835400660222000,
    "in_reply_to_status_id_str": "1112835400660221952",
    "in_reply_to_user_id": 473780756,
    "in_reply_to_user_id_str": "473780756",
    "in_reply_to_screen_name": "YumaInaura",
    "user": {
      "id": 473780756,
      "id_str": "473780756",
      "name": "0",
      "screen_name": "YumaInaura",
      "location": "",
      "description": "",
      "url": "https://t.co/8PZWB3UTuq",
      "entities": {
        "url": {
          "urls": [
            {
              "url": "https://t.co/8PZWB3UTuq",
              "expanded_url": "https://www.instagram.com/yumainaura/",
              "display_url": "instagram.com/yumainaura/",
              "indices": [
                0,
                23
              ]
            }
          ]
        },
        "description": {
          "urls": []
        }
      },
      "protected": false,
      "followers_count": 539,
      "friends_count": 0,
      "listed_count": 28,
      "created_at": "Wed Jan 25 09:59:57 +0000 2012",
      "favourites_count": 25059,
      "utc_offset": null,
      "time_zone": null,
      "geo_enabled": true,
      "verified": false,
      "statuses_count": 37617,
      "lang": "en",
      "contributors_enabled": false,
      "is_translator": false,
      "is_translation_enabled": false,
      "profile_background_color": "000000",
      "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://pbs.twimg.com/profile_images/1110446096596127744/wI7-uC6I_normal.jpg",
      "profile_image_url_https": "https://pbs.twimg.com/profile_images/1110446096596127744/wI7-uC6I_normal.jpg",
      "profile_banner_url": "https://pbs.twimg.com/profile_banners/473780756/1552991452",
      "profile_link_color": "1B95E0",
      "profile_sidebar_border_color": "000000",
      "profile_sidebar_fill_color": "000000",
      "profile_text_color": "000000",
      "profile_use_background_image": false,
      "has_extended_profile": false,
      "default_profile": false,
      "default_profile_image": false,
      "following": false,
      "follow_request_sent": false,
      "notifications": false,
      "translator_type": "none"
    },
    "geo": null,
    "coordinates": null,
    "place": null,
    "contributors": null,
    "is_quote_status": false,
    "retweet_count": 0,
    "favorite_count": 0,
    "favorited": false,
    "retweeted": false,
    "lang": "ja"
  },
  {
    "created_at": "Mon Apr 01 21:53:29 +0000 2019",
    "id": 1112835400660222000,
    "id_str": "1112835400660221952",
    "text": "このようにTwitterでセルフリプライのチェーンを繋げていき、それをあとで一本のブログに出来るようなのを用意すれば、自分の人生にどれだけ役立つかと思うのだ。ちょっとしたコストをかければすぐに出来るとは思う。ツリー構造を上へとたど… https://t.co/B20buqukMd",
    "truncated": true,
    "entities": {
      "hashtags": [],
      "symbols": [],
      "user_mentions": [],
      "urls": [
        {
          "url": "https://t.co/B20buqukMd",
          "expanded_url": "https://twitter.com/i/web/status/1112835400660221952",
          "display_url": "twitter.com/i/web/status/1…",
          "indices": [
            117,
            140
          ]
        }
      ]
    },
    "source": "<a href=\"https://mobile.twitter.com\" rel=\"nofollow\">Twitter Web App</a>",
    "in_reply_to_status_id": 1112834904448876500,
    "in_reply_to_status_id_str": "1112834904448876544",
    "in_reply_to_user_id": 473780756,
    "in_reply_to_user_id_str": "473780756",
    "in_reply_to_screen_name": "YumaInaura",
    "user": {
      "id": 473780756,
      "id_str": "473780756",
      "name": "0",
      "screen_name": "YumaInaura",
      "location": "",
      "description": "",
      "url": "https://t.co/8PZWB3UTuq",
      "entities": {
        "url": {
          "urls": [
            {
              "url": "https://t.co/8PZWB3UTuq",
              "expanded_url": "https://www.instagram.com/yumainaura/",
              "display_url": "instagram.com/yumainaura/",
              "indices": [
                0,
                23
              ]
            }
          ]
        },
        "description": {
          "urls": []
        }
      },
      "protected": false,
      "followers_count": 539,
      "friends_count": 0,
      "listed_count": 28,
      "created_at": "Wed Jan 25 09:59:57 +0000 2012",
      "favourites_count": 25059,
      "utc_offset": null,
      "time_zone": null,
      "geo_enabled": true,
      "verified": false,
      "statuses_count": 37617,
      "lang": "en",
      "contributors_enabled": false,
      "is_translator": false,
      "is_translation_enabled": false,
      "profile_background_color": "000000",
      "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://pbs.twimg.com/profile_images/1110446096596127744/wI7-uC6I_normal.jpg",
      "profile_image_url_https": "https://pbs.twimg.com/profile_images/1110446096596127744/wI7-uC6I_normal.jpg",
      "profile_banner_url": "https://pbs.twimg.com/profile_banners/473780756/1552991452",
      "profile_link_color": "1B95E0",
      "profile_sidebar_border_color": "000000",
      "profile_sidebar_fill_color": "000000",
      "profile_text_color": "000000",
      "profile_use_background_image": false,
      "has_extended_profile": false,
      "default_profile": false,
      "default_profile_image": false,
      "following": false,
      "follow_request_sent": false,
      "notifications": false,
      "translator_type": "none"
    },
    "geo": null,
    "coordinates": null,
    "place": null,
    "contributors": null,
    "is_quote_status": false,
    "retweet_count": 0,
    "favorite_count": 0,
    "favorited": false,
    "retweeted": false,
    "lang": "ja"
  },
  {
    "created_at": "Mon Apr 01 21:51:31 +0000 2019",
    "id": 1112834904448876500,
    "id_str": "1112834904448876544",
    "text": "転職ドラフトは自分で入力をしないと、審査が開始されない仕様らしい。これが何もせずともGithub連携などして審査が開始されるような仕様であれば、エンジニアは大喜びであろう。利用言語は自動解析できるだろうし、ポートフォリオなども、全… https://t.co/BPjTOlM8NC",
    "truncated": true,
    "entities": {
      "hashtags": [],
      "symbols": [],
      "user_mentions": [],
      "urls": [
        {
          "url": "https://t.co/BPjTOlM8NC",
          "expanded_url": "https://twitter.com/i/web/status/1112834904448876544",
          "display_url": "twitter.com/i/web/status/1…",
          "indices": [
            117,
            140
          ]
        }
      ]
    },
    "source": "<a href=\"https://mobile.twitter.com\" rel=\"nofollow\">Twitter Web App</a>",
    "in_reply_to_status_id": 1112834329275560000,
    "in_reply_to_status_id_str": "1112834329275559936",
    "in_reply_to_user_id": 473780756,
    "in_reply_to_user_id_str": "473780756",
    "in_reply_to_screen_name": "YumaInaura",
    "user": {
      "id": 473780756,
      "id_str": "473780756",
      "name": "0",
      "screen_name": "YumaInaura",
      "location": "",
      "description": "",
      "url": "https://t.co/8PZWB3UTuq",
      "entities": {
        "url": {
          "urls": [
            {
              "url": "https://t.co/8PZWB3UTuq",
              "expanded_url": "https://www.instagram.com/yumainaura/",
              "display_url": "instagram.com/yumainaura/",
              "indices": [
                0,
                23
              ]
            }
          ]
        },
        "description": {
          "urls": []
        }
      },
      "protected": false,
      "followers_count": 539,
      "friends_count": 0,
      "listed_count": 28,
      "created_at": "Wed Jan 25 09:59:57 +0000 2012",
      "favourites_count": 25059,
      "utc_offset": null,
      "time_zone": null,
      "geo_enabled": true,
      "verified": false,
      "statuses_count": 37617,
      "lang": "en",
      "contributors_enabled": false,
      "is_translator": false,
      "is_translation_enabled": false,
      "profile_background_color": "000000",
      "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://pbs.twimg.com/profile_images/1110446096596127744/wI7-uC6I_normal.jpg",
      "profile_image_url_https": "https://pbs.twimg.com/profile_images/1110446096596127744/wI7-uC6I_normal.jpg",
      "profile_banner_url": "https://pbs.twimg.com/profile_banners/473780756/1552991452",
      "profile_link_color": "1B95E0",
      "profile_sidebar_border_color": "000000",
      "profile_sidebar_fill_color": "000000",
      "profile_text_color": "000000",
      "profile_use_background_image": false,
      "has_extended_profile": false,
      "default_profile": false,
      "default_profile_image": false,
      "following": false,
      "follow_request_sent": false,
      "notifications": false,
      "translator_type": "none"
    },
    "geo": null,
    "coordinates": null,
    "place": null,
    "contributors": null,
    "is_quote_status": false,
    "retweet_count": 0,
    "favorite_count": 0,
    "favorited": false,
    "retweeted": false,
    "possibly_sensitive": false,
    "possibly_sensitive_appealable": false,
    "lang": "ja"
  },
  {
    "created_at": "Mon Apr 01 21:49:14 +0000 2019",
    "id": 1112834329275560000,
    "id_str": "1112834329275559936",
    "text": "世界を分報に変えよ。本当に苦手な事柄は、自分が好みとする事柄と、ミックスインすると良い。たとえば僕の場合、ただ単に転職ドラフトなどのサイトに慣れ親しむだけでも莫大なるコストを感じるが、こうやってTwitterなどで実況中継やアウトプットをすると、楽しみが増すように感じられる。#i",
    "truncated": false,
    "entities": {
      "hashtags": [
        {
          "text": "i",
          "indices": [
            138,
            140
          ]
        }
      ],
      "symbols": [],
      "user_mentions": [],
      "urls": []
    },
    "source": "<a href=\"https://mobile.twitter.com\" rel=\"nofollow\">Twitter Web App</a>",
    "in_reply_to_status_id": 1112833866710974500,
    "in_reply_to_status_id_str": "1112833866710974464",
    "in_reply_to_user_id": 473780756,
    "in_reply_to_user_id_str": "473780756",
    "in_reply_to_screen_name": "YumaInaura",
    "user": {
      "id": 473780756,
      "id_str": "473780756",
      "name": "0",
      "screen_name": "YumaInaura",
      "location": "",
      "description": "",
      "url": "https://t.co/8PZWB3UTuq",
      "entities": {
        "url": {
          "urls": [
            {
              "url": "https://t.co/8PZWB3UTuq",
              "expanded_url": "https://www.instagram.com/yumainaura/",
              "display_url": "instagram.com/yumainaura/",
              "indices": [
                0,
                23
              ]
            }
          ]
        },
        "description": {
          "urls": []
        }
      },
      "protected": false,
      "followers_count": 539,
      "friends_count": 0,
      "listed_count": 28,
      "created_at": "Wed Jan 25 09:59:57 +0000 2012",
      "favourites_count": 25059,
      "utc_offset": null,
      "time_zone": null,
      "geo_enabled": true,
      "verified": false,
      "statuses_count": 37617,
      "lang": "en",
      "contributors_enabled": false,
      "is_translator": false,
      "is_translation_enabled": false,
      "profile_background_color": "000000",
      "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://pbs.twimg.com/profile_images/1110446096596127744/wI7-uC6I_normal.jpg",
      "profile_image_url_https": "https://pbs.twimg.com/profile_images/1110446096596127744/wI7-uC6I_normal.jpg",
      "profile_banner_url": "https://pbs.twimg.com/profile_banners/473780756/1552991452",
      "profile_link_color": "1B95E0",
      "profile_sidebar_border_color": "000000",
      "profile_sidebar_fill_color": "000000",
      "profile_text_color": "000000",
      "profile_use_background_image": false,
      "has_extended_profile": false,
      "default_profile": false,
      "default_profile_image": false,
      "following": false,
      "follow_request_sent": false,
      "notifications": false,
      "translator_type": "none"
    },
    "geo": null,
    "coordinates": null,
    "place": null,
    "contributors": null,
    "is_quote_status": false,
    "retweet_count": 0,
    "favorite_count": 1,
    "favorited": false,
    "retweeted": false,
    "lang": "ja"
  },
  {
    "created_at": "Mon Apr 01 21:47:23 +0000 2019",
    "id": 1112833866710974500,
    "id_str": "1112833866710974464",
    "text": "転職ドラフトの正社員採用のプレゼントにうまい棒10万円分というものがあるが、ツッコミどころを満載に用意している感じがするよなあ。これを選ぶ人はきっと面白い社員、もしくはベタにお仕事ができます社員になることでしょう。うまい棒は安定感… https://t.co/uyav2ILByP",
    "truncated": true,
    "entities": {
      "hashtags": [],
      "symbols": [],
      "user_mentions": [],
      "urls": [
        {
          "url": "https://t.co/uyav2ILByP",
          "expanded_url": "https://twitter.com/i/web/status/1112833866710974464",
          "display_url": "twitter.com/i/web/status/1…",
          "indices": [
            117,
            140
          ]
        }
      ]
    },
    "source": "<a href=\"https://mobile.twitter.com\" rel=\"nofollow\">Twitter Web App</a>",
    "in_reply_to_status_id": 1112826051728564200,
    "in_reply_to_status_id_str": "1112826051728564224",
    "in_reply_to_user_id": 473780756,
    "in_reply_to_user_id_str": "473780756",
    "in_reply_to_screen_name": "YumaInaura",
    "user": {
      "id": 473780756,
      "id_str": "473780756",
      "name": "0",
      "screen_name": "YumaInaura",
      "location": "",
      "description": "",
      "url": "https://t.co/8PZWB3UTuq",
      "entities": {
        "url": {
          "urls": [
            {
              "url": "https://t.co/8PZWB3UTuq",
              "expanded_url": "https://www.instagram.com/yumainaura/",
              "display_url": "instagram.com/yumainaura/",
              "indices": [
                0,
                23
              ]
            }
          ]
        },
        "description": {
          "urls": []
        }
      },
      "protected": false,
      "followers_count": 539,
      "friends_count": 0,
      "listed_count": 28,
      "created_at": "Wed Jan 25 09:59:57 +0000 2012",
      "favourites_count": 25059,
      "utc_offset": null,
      "time_zone": null,
      "geo_enabled": true,
      "verified": false,
      "statuses_count": 37617,
      "lang": "en",
      "contributors_enabled": false,
      "is_translator": false,
      "is_translation_enabled": false,
      "profile_background_color": "000000",
      "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://pbs.twimg.com/profile_images/1110446096596127744/wI7-uC6I_normal.jpg",
      "profile_image_url_https": "https://pbs.twimg.com/profile_images/1110446096596127744/wI7-uC6I_normal.jpg",
      "profile_banner_url": "https://pbs.twimg.com/profile_banners/473780756/1552991452",
      "profile_link_color": "1B95E0",
      "profile_sidebar_border_color": "000000",
      "profile_sidebar_fill_color": "000000",
      "profile_text_color": "000000",
      "profile_use_background_image": false,
      "has_extended_profile": false,
      "default_profile": false,
      "default_profile_image": false,
      "following": false,
      "follow_request_sent": false,
      "notifications": false,
      "translator_type": "none"
    },
    "geo": null,
    "coordinates": null,
    "place": null,
    "contributors": null,
    "is_quote_status": false,
    "retweet_count": 0,
    "favorite_count": 1,
    "favorited": false,
    "retweeted": false,
    "possibly_sensitive": false,
    "possibly_sensitive_appealable": false,
    "lang": "ja"
  },
  {
    "created_at": "Mon Apr 01 21:16:20 +0000 2019",
    "id": 1112826051728564200,
    "id_str": "1112826051728564224",
    "text": "最終出社から早くも1週間が経過した。1ヶ月など飛ぶようにすぎるだろうという予感は、おそらく忠実に叶おうとしている。今日こそは転職ドラフトに渾身のエントリーシートを記入し、髪を切り、久しぶりに東京から戻った知人とも会う。",
    "truncated": false,
    "entities": {
      "hashtags": [],
      "symbols": [],
      "user_mentions": [],
      "urls": []
    },
    "source": "<a href=\"http://twitter.com/download/iphone\" rel=\"nofollow\">Twitter for iPhone</a>",
    "in_reply_to_status_id": 1110489119011074000,
    "in_reply_to_status_id_str": "1110489119011074048",
    "in_reply_to_user_id": 473780756,
    "in_reply_to_user_id_str": "473780756",
    "in_reply_to_screen_name": "YumaInaura",
    "user": {
      "id": 473780756,
      "id_str": "473780756",
      "name": "0",
      "screen_name": "YumaInaura",
      "location": "",
      "description": "",
      "url": "https://t.co/8PZWB3UTuq",
      "entities": {
        "url": {
          "urls": [
            {
              "url": "https://t.co/8PZWB3UTuq",
              "expanded_url": "https://www.instagram.com/yumainaura/",
              "display_url": "instagram.com/yumainaura/",
              "indices": [
                0,
                23
              ]
            }
          ]
        },
        "description": {
          "urls": []
        }
      },
      "protected": false,
      "followers_count": 539,
      "friends_count": 0,
      "listed_count": 28,
      "created_at": "Wed Jan 25 09:59:57 +0000 2012",
      "favourites_count": 25059,
      "utc_offset": null,
      "time_zone": null,
      "geo_enabled": true,
      "verified": false,
      "statuses_count": 37617,
      "lang": "en",
      "contributors_enabled": false,
      "is_translator": false,
      "is_translation_enabled": false,
      "profile_background_color": "000000",
      "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://pbs.twimg.com/profile_images/1110446096596127744/wI7-uC6I_normal.jpg",
      "profile_image_url_https": "https://pbs.twimg.com/profile_images/1110446096596127744/wI7-uC6I_normal.jpg",
      "profile_banner_url": "https://pbs.twimg.com/profile_banners/473780756/1552991452",
      "profile_link_color": "1B95E0",
      "profile_sidebar_border_color": "000000",
      "profile_sidebar_fill_color": "000000",
      "profile_text_color": "000000",
      "profile_use_background_image": false,
      "has_extended_profile": false,
      "default_profile": false,
      "default_profile_image": false,
      "following": false,
      "follow_request_sent": false,
      "notifications": false,
      "translator_type": "none"
    },
    "geo": null,
    "coordinates": null,
    "place": null,
    "contributors": null,
    "is_quote_status": false,
    "retweet_count": 0,
    "favorite_count": 1,
    "favorited": false,
    "retweeted": false,
    "lang": "ja"
  }
]

jq コマンドでテキストだけに絞り込む例

$ cat log/chain.log | jq --raw-output '.[].text'
転職ドラフトの前回 第17回のユーザーランキングを見ると、年収提示ランキングの最高額が1100万円であり、累計平均が最高のユーザーは975万円のようだ。これだけ有名なサービスでの、有象無象のエンジニアのトップがこれであると考えると… https://t.co/veQb92SbHo
転職ドラフトはエントリー期間対象外であった。こういう時に妙な罪悪感を持ち出して、もっと早く見ておけば良かったとか、動くのがおそすぎたのだと、自分を刃物で突き刺すのは愚策である。結果はあくまで結果論であり、過去の愛すべき自分だって、最善を尽くしたであろうから。#i
転職ドラフトという名前だけあって、期間が区切られてエントリーを受け付ける形式のようだ。ところで開催月は奇数月らしく、早速も、既に4月2日の今はエントリーが出来ぬことに気づく。次回は5月の開催。結果発表はそれよりも遅くなると考えると… https://t.co/FUBLhWk2mh
Qiitaなどの記事を一本書くことのコストというのは莫大である。なぜか。Twitterでないからだ。巨大なテキストの編集コストというものは、巨大に跳ね上がるように出来ている。しかしTwitterのように小さい粒のまとまりをスタック… https://t.co/M12LalFzrt
このようにTwitterでセルフリプライのチェーンを繋げていき、それをあとで一本のブログに出来るようなのを用意すれば、自分の人生にどれだけ役立つかと思うのだ。ちょっとしたコストをかければすぐに出来るとは思う。ツリー構造を上へとたど… https://t.co/B20buqukMd
転職ドラフトは自分で入力をしないと、審査が開始されない仕様らしい。これが何もせずともGithub連携などして審査が開始されるような仕様であれば、エンジニアは大喜びであろう。利用言語は自動解析できるだろうし、ポートフォリオなども、全… https://t.co/BPjTOlM8NC
世界を分報に変えよ。本当に苦手な事柄は、自分が好みとする事柄と、ミックスインすると良い。たとえば僕の場合、ただ単に転職ドラフトなどのサイトに慣れ親しむだけでも莫大なるコストを感じるが、こうやってTwitterなどで実況中継やアウトプットをすると、楽しみが増すように感じられる。#i
転職ドラフトの正社員採用のプレゼントにうまい棒10万円分というものがあるが、ツッコミどころを満載に用意している感じがするよなあ。これを選ぶ人はきっと面白い社員、もしくはベタにお仕事ができます社員になることでしょう。うまい棒は安定感… https://t.co/uyav2ILByP
最終出社から早くも1週間が経過した。1ヶ月など飛ぶようにすぎるだろうという予感は、おそらく忠実に叶おうとしている。今日こそは転職ドラフトに渾身のエントリーシートを記入し、髪を切り、久しぶりに東京から戻った知人とも会う。

Original by Github issue

チャットメンバー募集

何か質問、悩み事、相談などあればLINEオープンチャットもご利用ください。

Twitter

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1