Skip to content

Instantly share code, notes, and snippets.

@gin135
Created April 6, 2017 05:34
Show Gist options
  • Save gin135/f22a44b372d5b9e8b413d963aa68ae15 to your computer and use it in GitHub Desktop.
Save gin135/f22a44b372d5b9e8b413d963aa68ae15 to your computer and use it in GitHub Desktop.
JR関東地方の運行状況を取得するシェル芸
#!/bin/sh
curl -s http://traininfo.jreast.co.jp/train_info/kanto.aspx |
nkf -Lu |
grep -A 1 'text-tit-xlarge' |
sed '/acess_i/s/.*alt="\([^"]*\)".*/\1/' |
sed 's/<[^>]*>//g' |
tr -d -- '- ' |
awk NF=NF |
xargs -n 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment