search
LoginSignup
2

More than 5 years have passed since last update.

posted at

updated at

Organization

tmuxのstatus-lineにtwitterを表示させる遊び

tのインストール&初期設定

$gem install t
$t authorize

t authorizeでアクセストークン取得のためのwebページが開くので,テキトーに埋めてaccess tokenとaccess secret tokenを取得しましょう.
(必須項目埋めても弾かれる場合→ 電話番号登録)

tmux.confに追記

tmux.conf
set -g status-left "#(t timeline -n 1)"

これでとりあえずは見られる.

ただstatus-interval 1とか指定してるとすぐにAPI切れになる…
多分一旦別ファイルに落としていって,そのファイルを監視したほうが効率良い.

ので,.tmux.confには,こんな感じで書いておいて

tmux.conf
set -g status-left "#(cat /tmp/tweet|tail -n 3|head -n 2|tr -d '\n')"

立ち上げ時に以下のコマンドを発火させるように

$t stream timeline>/tmp/tweet&

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
What you can do with signing up
2