[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] r15536: Removed dupe mirror entry, updated horrible looping to make (website/trunk)



Author: ioerror
Date: 2008-06-28 00:53:18 -0400 (Sat, 28 Jun 2008)
New Revision: 15536

Modified:
   website/trunk/update-mirrors.pl
Log:
Removed dupe mirror entry, updated horrible looping to make it less horrible, made output format not ruin page widths, etc


Modified: website/trunk/update-mirrors.pl
===================================================================
--- website/trunk/update-mirrors.pl	2008-06-28 04:23:26 UTC (rev 15535)
+++ website/trunk/update-mirrors.pl	2008-06-28 04:53:18 UTC (rev 15536)
@@ -4,6 +4,7 @@
 use LWP::Simple;
 use LWP;
 use Date::Parse;
+use Date::Format;
 
 print "Creating LWP agent ($LWP::VERSION)...\n";
 my $lua = LWP::UserAgent->new(
@@ -94,22 +95,6 @@
             updateDate => "",
         },
 
-       mirror001 => {
-            orgName => "depthstrike.com",
-            isoCC => "CA",
-            subRegion => "NS",
-            region => "North America",
-            ipv4 => "True",
-            ipv6 => "False",
-            loadBalanced => "Unknown",
-            httpWebsiteMirror => "http://tor.depthstrike.com/";,
-            ftpWebsiteMirror => "",
-            rsyncWebsiteMirror => "",
-            httpDistMirror => "http://tor.depthstrike.com/dist/";,
-            rsyncDistMirror => "",
-            updateDate => "",
-        },
-
        mirror002 => {
             orgName => "hermetix.org",
             isoCC => "CA",
@@ -563,7 +548,7 @@
        mirror028 => {
             adminContact => "jeroen\@unfix.org",
             orgName => "sixx",
-            isoCC => "",
+            isoCC => "CH",
             subRegion => "",
             region => "Europe",
             ipv4 => "True",
@@ -624,19 +609,29 @@
 # This is storted from last known recent update to unknown update times
 foreach my $server ( sort { $m{$b}{'updateDate'} <=> $m{$a}{'updateDate'}} keys %m ) {
 
-     # Country    Organisation    website mirror      dist/ mirror
-     print OUT "\n<tr>\n";
-     print OUT "    <td>$m{$server}{'isoCC'}</td>\n";
-     print OUT "    <td>$m{$server}{'orgName'}</td>\n";
-     print OUT "    <td>$m{$server}{'updateDate'}</td>\n";
+     my $time = ctime($m{$server}{'updateDate'});
+     chomp($time);
+print OUT <<"END";
+     \n<tr>\n
+         <td>$m{$server}{'isoCC'}</td>\n
+         <td>$m{$server}{'orgName'}</td>\n
+         <td>$time</td>\n
+END
 
-     foreach my $precious ( "httpWebsiteMirror", "ftpWebsiteMirror", 
-                            "rsyncWebsiteMirror","httpDistMirror",
-                            "rsyncDistMirror" )
+     my %prettyNames = (
+                        httpWebsiteMirror => "http",
+                        httpsWebsiteMirror => "https",
+                        ftpWebsiteMirror => "ftp",
+                        rsyncWebsiteMirror => "rsync",
+                        httpDistMirror => "http",
+                        httpsDistMirror => "https",
+                        rsyncDistMirrors => "rsync", );
+
+     foreach my $precious ( sort keys %prettyNames )
      {
         if ($m{$server}{"$precious"}) {
             print OUT "    <td><a href=\"" . $m{$server}{$precious} . "\">" .
-                      "$m{$server}{$precious}</a></td>\n";
+                      "$prettyNames{$precious}</a></td>\n";
         } else { print OUT "    <td> - </td>\n"; }
      }