12345678910111213141516171819202122232425262728293031323334353637383940 |
- #!/bin/rc
- #
- # get AP news headline list or the given story
- #
- wire='http://www.newsday.com/news/nationworld/wire'
- if ( ~ $#* 0 )
- hget $wire | #tee /tmp/ap.$pid |
- sed -n '/LAST 7 DAYS/,/end last 7 days/p' |
- htmlfmt -a -w 100 |
- sed -n '
- /^• / {
- N
- s/^• / /g
- s/\n/ /g
- s/\[\/news\/nationworld\/wire\//|/
- s/sns-ap-//
- s/,[0-9]+,[0-9]+\.story.*$//
- p
- }' |
- awk -F '|' '
- {
- s = "";
- for (i = 1; i < NF; i++)
- s = s " " $i;
- printf("ap %-40s # %s\n", $NF, s);
- }'
- if not
- hget $wire/sns-ap-^$1^.story |
- htmlfmt |
- sed '
- s/\| Article licensing.*$//
- /^Copyright ©/p
- /^Copyright ©/,$d
- /^Subscribe to Newsday/d
- 1,/^Top Stories$/d
- s/[ ]*$//
- s/^\* __$//
- ' #| fmt
|