Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 53 lines (38 sloc) 1.2 KB
#!/bin/bash
# grr. argh
if [ -z $CBROOTLOCAL ];
then
echo "CBROOTLOCAL not configured"
exit 2
fi
workpath=`$CBROOT/bin/cbconfig work_path`/tmp
targetpath=`$CBROOT/bin/cbconfig work_path`/rss
mkdir -p $targetpath $workpath
function getrss () {
target="$1.rss"
targettemp="${workpath}/${target}.new"
url=$2
timecond=""
if [ -e ${target} ]; then
timecond="-z ${target}"
fi
curl -LA "www.perl.org/cron_hourly (github.com/perlorg/perlweb)" -sf ${timecond} -o ${targettemp} $url
if [ $? -eq 0 ]; then
mv $targettemp $targetpath/$target
fi
}
getrss "cpanrecent" "https://metacpan.org/feed/recent?f="
getrss "tpfblog" "http://news.perlfoundation.org/index.xml"
getrss "noc" "http://log.perl.org/feeds/posts/default?alt=rss"
getrss "jobs" "http://jobs.perl.org/rss/standard.rss?limit=5"
getrss "perlbuzz" "http://perlbuzz.com/rss.xml"
getrss "perlnews" "http://feeds.feedburner.com/PerlNews"
function getcpanstats () {
curl -LA 'www.perl.org/cron_hourly' \
-sf \
-o $targetpath/cpan-stats.json \
-z $targetpath/cpan-stats.json \
http://www.cpan.org/indices/cpan-stats.json
}
getcpanstats
$CBROOT/bin/cron/hourly