Closed ghost closed 7 years ago
If you don't figure this out, I shall look into it next week.
not a problem. just an updated script to get nicer output. the attached .txt contains the correct changes-- i don't recommend copying the text in the 1st post because some spaces were removed by the code filter.
[edit: link to updated script (as text). same output, but it remove unnecessary code and replaces inline constants with variables defined at the top for easier maintainence]
afreeca_vlc.sh.txt
I'm not too sure what the actual columns are supposed to be, but this does depend on them terminating with 'Now' in order to fix alignment.
curl -s https://afreecabw.appspot.com/ | sed -e '/<tr class="offline show">/,+7d' | awk -F '[<>]' 'BEGIN {ORS=" "}; /<td / { gsub(/<b>/, ""); sub(/ .*/, "", $3); print $3 } ' | sed s'/Now /Now\n/'g | sed s'/ / unknown /'g | sed 1s'/^/Player Race Viewers MaxView Avail\n/' | column -t
Btw, just tested this. it is correct b/c the edit code is correct, but it doesn't filter right even through code tags. there are TWO spaces within /Now / and TWO spaces in the / / before unknown.