2018-05-18   ruby   twitter   web   image 

ツイートのURLを与えると添付画像をダウンロードするRubyスクリプト

参照

https://qiita.com/mataneko_boy/items/852ca5484b80d2530560

スクリプト

https://gist.github.com/hyuki/163340e4f5924c9ab8fb66c84f378132

実行結果

$ ruby twitter-get-image.rb https://twitter.com/hyuki/status/995912906477731840
"ベクトルっていったい何だろう。数なの? 矢印なの? ベクトルの内積って何? 『数学ガールの秘密ノート/ベクトルの真実』好評発売中!\nhttps://t.co/nascbVOma9 https://t.co/aWDuCbSMcr"
true
"http://pbs.twimg.com/media/DdIxgMWVQAAPCtA.jpg"
1.jpg
"http://pbs.twimg.com/media/DdIxgj_XcAA2QUK.jpg"
2.jpg
$ ls *.jpg
1.jpg 2.jpg
 2018-05-18   ruby   twitter   web   image