Mercurial > hg > index.fcgi > www > www-1
view myrss/myrss_update.sh @ 18:3551de5fef13
update FEEDS; parallelize feed processing
author | paulo@thepaulopc |
---|---|
date | Wed, 10 Nov 2010 00:05:53 -0800 |
parents | 5a0c2ee709f8 |
children | fce61e65e3ae |
line source
1 #!/bin/sh
3 TIMESTAMP=$(date '+%FT%T%:z')
4 TIMEOUT=60
6 i=0
7 for URL in $(grep -v '^#' FEEDS)
8 do
9 FN=$((i++)).feedtmp
10 wget -q -T ${TIMEOUT} -U '' -O - ${URL} | xsltproc step1.xsl - | xsltproc step2.xsl - > ${FN} &
11 done
13 wait
15 BODY=''
16 for j in $(seq 0 ${i})
17 do
18 BODY=${BODY}$(cat ${j}.feedtmp)
19 done
21 echo '<HTML>'
22 echo '<HEAD>'
23 echo "<TITLE>${TIMESTAMP}</TITLE>"
24 echo '<LINK REL="stylesheet" TYPE="text/css" HREF="index.css">'
25 echo '</HEAD>'
27 echo '<BODY>'
28 echo "<H1>${TIMESTAMP}</H1>"
30 echo ${BODY}
32 echo '</BODY>'
33 echo '</HTML>'
35 rm *.feedtmp