shithub: rc

ref: b37f3b14f650cdee89f44378fa3b5dd2b5daf567
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
}