shithub: rc

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