shithub: rc

ref: 7961c4726d72d68de40341a7e9c846229bd14311
dir: /oktr/

View raw version
#!/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
}