ap 665 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #!/bin/rc
  2. #
  3. # get AP news headline list or the given story
  4. #
  5. tmp=/tmp/tmp.$pid
  6. wire='http://www.newsday.com/news/nationworld/wire'
  7. if ( ~ $#* 0 )
  8. hget $wire | tee /tmp/ap.tmp |
  9. htmlfmt -a -w 100 |
  10. sed -n '
  11. 1,/On Wall Street/d
  12. /AP News Wire/,$d
  13. /^• / {
  14. N
  15. s/^• / /g
  16. s/\n/ /g
  17. s/\[\/news\/nationworld\/wire\//|/
  18. s/,[0-9]+,[0-9]+\.story.*$//
  19. p
  20. }' |
  21. awk -F '|' '
  22. {
  23. s = "";
  24. for (i = 1; i < NF; i++)
  25. s = s " " $i;
  26. printf("%-40s %s\n", $NF, s);
  27. }'
  28. if not
  29. hget $wire/^$1^.story |
  30. htmlfmt |
  31. sed '
  32. 1,/^By Associated Press$/d
  33. s/\| Article licensing.*$//
  34. /^Copyright ©/p
  35. /^Copyright ©/,$d
  36. '