Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

executable file 60 lines (40 sloc) 1.43 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
/usr/bin/lwp-request \
$url > ${targettemp}
if [ $? -eq 0 ]; then
mv $targettemp $targetpath/$target
fi
}
getrss "cpanrecent" "http://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 () {
target="cpan.dat"
targettemp="${workpath}/cpan.dat.new"
echo "mb : mirrors : authors : modules" > $targettemp
/usr/bin/lwp-request http://www.cpan.org/index.html |
perl -ne 'm!(\d+) MB (\d+) mirrors<br/>(\d+) authors (\d+) modules!i && print qq!$1 : $2 : $3 : $4\n!' >> $targettemp
if [ $? -eq 0 ]; then
mv $targettemp $targetpath/$target
fi
# Switch over to using this:
lwp-mirror -t10m http://www.cpan.org/indices/cpan-stats.json $targetpath/cpan-stats.json 2> >(grep -v 'up to date')
}
getcpanstats
$CBROOT/bin/cron/hourly
Jump to Line
Something went wrong with that request. Please try again.