2016-10-07 21:18:21 -04:00
|
|
|
#!/usr/bin/env bash
|
2016-10-27 18:55:07 -04:00
|
|
|
sum() {
|
|
|
|
declare -i acc
|
|
|
|
for i; do acc+=i; done
|
|
|
|
echo $acc
|
|
|
|
}
|
2016-10-07 21:18:21 -04:00
|
|
|
|
2016-10-27 18:55:07 -04:00
|
|
|
curl -s 'http://www.xkcdb.com/?random1' |
|
|
|
|
hxnormalize -i 0 -l 99999999999 -x | hxselect -cs '<br>\n%<br>\n' 'span.quote' |
|
|
|
|
html2text -b 0 | hxunent | sed '$d; s/ *$//' | sed '$d'
|
|
|
|
exit $(sum ${PIPESTATUS[*]})
|