usps 450 B

123456789101112131415161718192021222324
  1. #!/bin/rc
  2. rfork en
  3. if(! ~ $#* 1) {
  4. echo usage: usps 01601531218002685498 >[1=2]
  5. exit usage
  6. }
  7. rfork e
  8. hget -p 'tracknbr='^$1 http://www.framed.usps.com/cgi-bin/cttgate/ontrack.cgi |
  9. tr -d ' ' |
  10. sed 's/<[^>]*>//g' |
  11. sed 's/\&quot;/"/g;s/\&lt;/</g;s/\&gt;/>/g;s/\&amp;/\&/g' |
  12. sed 's/\&(copy|nbsp);//' |
  13. grep -v Copyright |
  14. grep -v 'You can track' |
  15. grep -v 'Enter the number' |
  16. grep -v 'Item Number:' |
  17. sed 's/[ ]*$//' |
  18. uniq |
  19. fmt