Sigrid Solveig Haflínudóttiriss: better alignmentff2278d10 years agoHistory
40 lines · 597 B · Text
RawDownload
#!/bin/rc country=$1region=$2city=$3if($#* = 2){	city=$region	region=None}if(test $#* -lt 2){	echo usage: iss country [region] city	exit usage} hget 'http://spotthestation.nasa.gov/sightings/view.cfm?country='^$country^'&region='^$region^'&city='^$city | awk '	BEGIN{		head=0		a[1] = 20		a[2] = 9		a[3] = 13		a[4] = 16		a[5] = 16	}	/<[\/]t[hd]>/ && !/Share/ {		gsub(/[ \t]*<[^ >][^>]*>[ \t]*/, "")		sub(/&deg;/, "°")		if($0 != ""){			if(head > 3)				a[3] = 13			head++			printf "%"a[head]"s", $0		}	}	/<tr>/ && head {		print ""		head = 0	}	END {		print ""	}'