comparison myrss/myrss_update.sh @ 93:c33c0647bf84

myrss: update FEEDS
author paulo
date Thu, 02 Nov 2017 11:57:59 -0600
parents fce61e65e3ae
children
comparison
equal deleted inserted replaced
4:015eecda3dc7 5:0dc7febd0b56
1 #!/bin/sh 1 #!/bin/sh
2 2
3 TIMESTAMP=$(date '+%FT%T%:z') 3 TIMESTAMP=$(date '+%FT%T%:z')
4 TIMEOUT=60 4 TIMEOUT=60
5 MAXPROCS=20
5 6
6 i=0 7 i=0
8 n=0
7 for URL in $(grep -v '^#' FEEDS) 9 for URL in $(grep -v '^#' FEEDS)
8 do 10 do
9 FN=$((i++)).feedtmp 11 FN=$((++i)).feedtmp
10 wget -q -T ${TIMEOUT} -U '' -O - ${URL} | xsltproc step1.xsl - | xsltproc step2.xsl - > ${FN} & 12 wget -q -T ${TIMEOUT} -U '' -O - ${URL} | xsltproc step1.xsl - | xsltproc step2.xsl - > ${FN} &
13 if (( $((++n)) > ${MAXPROCS} ))
14 then
15 wait
16 n=0
17 fi
11 done 18 done
12 19
13 wait 20 wait
14 21
15 echo '<HTML>' 22 echo '<HTML>'
19 echo '</HEAD>' 26 echo '</HEAD>'
20 27
21 echo '<BODY>' 28 echo '<BODY>'
22 echo "<H1>${TIMESTAMP}</H1>" 29 echo "<H1>${TIMESTAMP}</H1>"
23 30
24 for j in $(seq 0 ${i}) 31 for j in $(seq 1 ${i})
25 do 32 do
26 cat ${j}.feedtmp 33 cat ${j}.feedtmp
27 done 34 done
28 35
29 echo '</BODY>' 36 echo '</BODY>'