Skip to content

Instantly share code, notes, and snippets.

@h3y6e
Last active February 24, 2019 14:42
Show Gist options
  • Save h3y6e/8adcac2f571c529ab1e29a5666801644 to your computer and use it in GitHub Desktop.
Save h3y6e/8adcac2f571c529ab1e29a5666801644 to your computer and use it in GitHub Desktop.
Twitterの動画をMarkdownに埋め込む方法

例としてこのツイートを使います https://twitter.com/5ebec/status/1047427791606538240

サムネイルの取得

Chrome等のデベロッパーツールからSourcesにアクセス.
r'https://pbs\.twimg\.com/ext_tw_video_thumb/[\d]+/pu/img/[\w\-]+\.(jpg|png)' のURLにある画像がサムネイル.
TODO:↑これを自動で取得したい

Markdown記法で以下のように書く

[![thumbnail](https://pbs.twimg.com/ext_tw_video_thumb/1047427651223212034/pu/img/IqA06LoI-t5msSaF.jpg)](https://twitter.com/5ebec/status/1047427791606538240/video/1)

完成

thumbnail

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment