Author: dom Date: 2006-04-06 20:49:14 +0100 (Thu, 06 Apr 2006) New Revision: 754
Added: utils/ utils/README utils/get-guide-versions Log: Add utils dir, with get-guide-versions in it.
Added: utils/README =================================================================== --- utils/README 2006-04-05 01:26:00 UTC (rev 753) +++ utils/README 2006-04-06 19:49:14 UTC (rev 754) @@ -0,0 +1,2 @@ +This directory is for small bits and pieces that don't have anywhere else to +go. Use anything you find here at your own risk!
Added: utils/get-guide-versions =================================================================== --- utils/get-guide-versions 2006-04-05 01:26:00 UTC (rev 753) +++ utils/get-guide-versions 2006-04-06 19:49:14 UTC (rev 754) @@ -0,0 +1,53 @@ +#!/usr/bin/perl +# +# Prints out a list of guides and the software versions they're using. + +use strict; +use warnings; +use WWW::Mechanize; + +my $out = "/srv/www/dev.openguides.org/html/static/versions.html"; + +my %guides = ( Birmingham => 'http://birmingham.openguides.org/', + Chester => 'http://chesterguide.org.uk/', + Cotswolds => 'http://cotswolds.openguides.org/', + Glasgow => 'http://glasgow.openguides.org/', + Lancaster => 'http://lancaster.openguides.org/', + London => 'http://london.openguides.org/', + Manchester => 'http://manchester.openguides.org/', + 'Milton Keynes' => 'http://miltonkeynes.openguides.org/', + Norwich => 'http://norwich.openguides.org/', + Nottingham => 'http://nottingham.openguides.org/', + Oxford => 'http://oxford.openguides.org/', + 'Vegan Oxford' => 'http://the.earth.li/~kake/cgi-bin/openguides/vegan-oxford.cgi', + Southampton => 'http://southampton.openguides.org/', + Vienna => 'http://vienna.openguides.org/', + 'Victoria, BC' => 'http://victoria.openguides.org/', + 'Boston, MA' => 'http://boston.openguides.org/', + 'Saint Paul, MN' => 'http://saintpaul.openguides.org/', + 'The Tourist Engineer' => 'http://engineer.openguides.org/' + ); + +my $mech = WWW::Mechanize->new(agent => "OpenGuides get-guide-versions", + autocheck => 1); + +open OUT, ">$out" or die $!; + +print OUT "<html><head><title>Versions of OpenGuides in use</title></head>\n"; +print OUT "<body><table>\n"; + +foreach my $guide (keys %guides) { + print OUT "<tr><td><a href="$guides{$guide}">$guide</td><td>"; + $mech->get($guides{$guide}); + my $content = $mech->content; + if ($content =~ /version.(0.\d+)/s) { + print OUT $1; + } else { + print OUT "Not found"; + } + print OUT "</td></tr>\n"; +} + +print OUT "</table></body></html>\n"; + +close OUT;
Property changes on: utils/get-guide-versions ___________________________________________________________________ Name: svn:executable + *