ref: 26fb5eb9efc7fe76b45cafefd313d1d2a9ccd9d6
dir: /oktr/
#!/bin/rc
# read posts from okturing.com.
rfork e
# br is 80 columns wide
br='-------------------------------------------------------------------------------- ' # unicode 00a0 at the end
lines=10
posts=5
top=`{hget http://okturing.com |
grep body |
sed -n 3p |
sed 's/^.*src\///; s/\/body" .*$//'
}
if(~ $top '')
exit
for(i in `{seq `{echo $top - 5 | bc} $top}){
url=http://okturing.com/src/$i/body
echo $br
echo hget $url ' ' # unicode 00a0 at the end
echo
hget $url |
awk 'NR<'^$lines^'{print; next}{ print "\n( more ) "; exit}' # unicode 00a0 at the end
echo
echo
}