-
Notifications
You must be signed in to change notification settings - Fork 99
/
Copy pathcron_hourly
executable file
·52 lines (38 loc) · 1.22 KB
/
cron_hourly
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/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" "https://jobs.perl.org/rss/standard.rss?limit=5"
getrss "perlnews" "https://www.perl.com/article/index.xml"
getrss "perl-releases" "https://metacpan.org/feed/distribution/perl"
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