Skip to content

Commit

Permalink
Refactor so that list of months is separate; add Jan 2010. Don't fetc…
Browse files Browse the repository at this point in the history
…h files we already have in the cache.
  • Loading branch information
iay committed Jan 5, 2010
1 parent a2b1731 commit e563eff
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 34 deletions.
19 changes: 19 additions & 0 deletions charting/Months.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/perl -w

#
# Months.pm
#
use File::stat;

@months = (
'2006-12',
'2007-01', '2007-02', '2007-03', '2007-04', '2007-05', '2007-06',
'2007-07', '2007-08', '2007-09', '2007-10', '2007-11', '2007-12',
'2008-01', '2008-02', '2008-03', '2008-04', '2008-05', '2008-06',
'2008-07', '2008-08', '2008-09', '2008-10', '2008-11', '2008-12',
'2009-01', '2009-02', '2009-03', '2009-04', '2009-05', '2009-06',
'2009-07', '2009-08', '2009-09', '2009-10', '2009-11', '2009-12',
'2010-01',
);

1;
28 changes: 14 additions & 14 deletions charting/fetch.pl
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,25 @@
# fetch.pl
#
use File::stat;
use Months;

$fn = '../xml/ukfederation-metadata.xml';
$fn2 = '../xml/ukfederation-stats.html';

@months = (
'2006-12',
'2007-01', '2007-02', '2007-03', '2007-04', '2007-05', '2007-06',
'2007-07', '2007-08', '2007-09', '2007-10', '2007-11', '2007-12',
'2008-01', '2008-02', '2008-03', '2008-04', '2008-05', '2008-06',
'2008-07', '2008-08', '2008-09', '2008-10', '2008-11', '2008-12',
'2009-01', '2009-02', '2009-03', '2009-04', '2009-05', '2009-06',
'2009-07', '2009-08', '2009-09', '2009-10', '2009-11', '2009-12',
);

foreach $month (@months) {
print "Fetching $month...";
system("svn update $fn --quiet --revision \\{$month-01T00:00:00Z\\}");
system("cp $fn cache/$month.xml");
system("svn update $fn2 --quiet --revision \\{$month-01T00:00:00Z\\}");
system("cp $fn2 cache/$month.html");

my $dest1 = "cache/$month.xml";
if (!-e $dest1) {
system("svn update $fn --quiet --revision \\{$month-01T00:00:00Z\\}");
system("cp $fn $dest1");
}

my $dest2 = "cache/$month.html";
if (!-e $dest2) {
system("svn update $fn2 --quiet --revision \\{$month-01T00:00:00Z\\}");
system("cp $fn2 $dest2");
}

print "\n";
}
11 changes: 1 addition & 10 deletions charting/saml2.pl
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,7 @@
#
use lib "../build";
use Xalan;

@months = (
'2006-12',
'2007-01', '2007-02', '2007-03', '2007-04', '2007-05', '2007-06',
'2007-07', '2007-08', '2007-09', '2007-10', '2007-11', '2007-12',
'2008-01', '2008-02', '2008-03', '2008-04', '2008-05', '2008-06',
'2008-07', '2008-08', '2008-09', '2008-10', '2008-11', '2008-12',
'2009-01', '2009-02', '2009-03', '2009-04', '2009-05', '2009-06',
'2009-07', '2009-08', '2009-09', '2009-10', '2009-11', '2009-12',
);
use Months;

# ingest files
foreach $month (@months) {
Expand Down
11 changes: 1 addition & 10 deletions charting/sizes.pl
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,7 @@
# sizes.pl
#
use File::stat;

@months = (
'2006-12',
'2007-01', '2007-02', '2007-03', '2007-04', '2007-05', '2007-06',
'2007-07', '2007-08', '2007-09', '2007-10', '2007-11', '2007-12',
'2008-01', '2008-02', '2008-03', '2008-04', '2008-05', '2008-06',
'2008-07', '2008-08', '2008-09', '2008-10', '2008-11', '2008-12',
'2009-01', '2009-02', '2009-03', '2009-04', '2009-05', '2009-06',
'2009-07', '2009-08', '2009-09', '2009-10', '2009-11', '2009-12',
);
use Months;

# ingest files
foreach $month (@months) {
Expand Down

0 comments on commit e563eff

Please sign in to comment.