3
3

More than 5 years have passed since last update.

curlコマンドを1秒ごとに実行する

Last updated at Posted at 2017-12-31

やりたいこと

以下のcurlコマンドを1秒ごとに実行したい。

curlコマンド
curl https://www.coingecko.com/ja/%E7%9B%B8%E5%A0%B4%E3%83%81%E3%83%A3%E3%83%BC%E3%83%88/%E3%83%AA%E3%83%83%E3%83%97%E3%83%AB/jpy | grep -e "今日のリップル の価格は <b><span>"

最近rippleコインに注目しているので、わざわざrippleチャートサイトにアクセスするのがめんどくさいので自動化して出力させる通知アプリを作りたい。

結論

watchコマンドを使用する。

1秒ごとに値を取得してきてくれるコマンド
watch -n 1 "curl https://www.coingecko.com/ja/%E7%9B%B8%E5%A0%B4%E3%83%81%E3%83%A3%E3%83%BC%E3%83%88/%E3%83%AA%E3%83%83%E3%83%97%E3%83%AB/jpy | grep -e '今日のリップル の価格は <b><span>'"

まだ邪魔な部分があるけど一旦は気にしない。
アプリにするのは来年ーー

3
3
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
3
3