code: plan9front

ref: c2a315c78e42a9e161011c7b0559d5d54c103d21
dir: /rc/bin/wurl2txt/

View raw version
#!/bin/rc

switch($#*){
case 0
	exit
case 1
	name = /`{echo $1 | sed 's;.*//;;
		s;/.*;;'}^/webpage
	# send hget errors to 2 so they appear in window
	hget $1 >[2=1]| {echo $1; echo; htmlfmt} >[2=1] | plumb -i -d edit -a 'action=showdata filename='$name
	exit
case *
	for(i in *)
		wurl2txt $i
}