annotate myrss/myrss_update.sh @ 129:bd8a61f9162f

myrss2: add San Mateo Daily Journal to FEEDS
author paulo
date Tue, 11 Jan 2022 02:36:16 -0800
parents fce61e65e3ae
children
rev   line source
paulo@8 1 #!/bin/sh
paulo@8 2
paulo@9 3 TIMESTAMP=$(date '+%FT%T%:z')
paulo@18 4 TIMEOUT=60
paulo@27 5 MAXPROCS=20
paulo@18 6
paulo@18 7 i=0
paulo@27 8 n=0
paulo@18 9 for URL in $(grep -v '^#' FEEDS)
paulo@18 10 do
paulo@27 11 FN=$((++i)).feedtmp
paulo@27 12 wget -q -T ${TIMEOUT} -U '' -O - ${URL} | xsltproc step1.xsl - | xsltproc step2.xsl - > ${FN} &
paulo@27 13 if (( $((++n)) > ${MAXPROCS} ))
paulo@27 14 then
paulo@27 15 wait
paulo@27 16 n=0
paulo@27 17 fi
paulo@18 18 done
paulo@18 19
paulo@18 20 wait
paulo@18 21
paulo@9 22 echo '<HTML>'
paulo@9 23 echo '<HEAD>'
paulo@9 24 echo "<TITLE>${TIMESTAMP}</TITLE>"
paulo@9 25 echo '<LINK REL="stylesheet" TYPE="text/css" HREF="index.css">'
paulo@9 26 echo '</HEAD>'
paulo@9 27
paulo@9 28 echo '<BODY>'
paulo@9 29 echo "<H1>${TIMESTAMP}</H1>"
paulo@8 30
paulo@27 31 for j in $(seq 1 ${i})
paulo@19 32 do
paulo@19 33 cat ${j}.feedtmp
paulo@19 34 done
paulo@9 35
paulo@9 36 echo '</BODY>'
paulo@9 37 echo '</HTML>'
paulo@18 38
paulo@18 39 rm *.feedtmp