shithub: rc

ref: e3fd8f1a5605ba41454588478a2bddf956cee5c5
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 - $posts | bc} $top}){
	url=http://okturing.com/src/$i/body
	echo $br
	echo hget $url
	echo
	hget $url | 
		awk 'NR<'^$lines^'{print; next}{ print "\n# more "; exit}'	# unicode 00a0 at the end
	echo
	echo
}