changelog shortlog tags branches changeset files revisions annotate raw help

Mercurial > hg > plan9front / rc/bin/ap

changeset 7243: 34f64dcbbc25
parent: efddda59690a
author: cinap_lenrek@felloff.net
date: Fri, 17 May 2019 18:14:10 +0200
permissions: -rwxr-xr-x
description: 7l: don't hardcode 4k pagesize, use INITRND
1 #!/bin/rc
2 #
3 # get AP news headline list or the given story
4 #
5 
6 wire='http://www.newsday.com/news/nationworld/wire'
7 if ( ~ $#* 0 )
8  hget $wire | #tee /tmp/ap.$pid |
9  sed -n '/<h1>AP Top News/,/AP News Wire/p' |
10  htmlfmt -a -w 100 |
11  sed -n '
12  /^• / {
13  N
14  s/^• / /g
15  s/\n/ /g
16  s/\[\/news\/nationworld\/wire\//|/
17  s/sns-ap-//
18  s/\.story.*$//
19  p
20  }' |
21  awk -F '|' '
22  {
23  s = "";
24  for (i = 1; i < NF; i++)
25  s = s " " $i;
26  printf("ap %-40s # %s\n", $NF, s);
27  }'
28 
29 if not
30  hget $wire/sns-ap-^$1^.story |
31  htmlfmt |
32  sed '
33  1,/^AP Top News$/d
34  /^\* __$/,$d
35  /^Subscribe to Newsday home delivery/,$d
36  '