gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r2626 - GNUnet-docs/WWW


From: grothoff
Subject: [GNUnet-SVN] r2626 - GNUnet-docs/WWW
Date: Sat, 22 Apr 2006 08:04:35 -0700 (PDT)

Author: grothoff
Date: 2006-04-22 08:04:34 -0700 (Sat, 22 Apr 2006)
New Revision: 2626

Added:
   GNUnet-docs/WWW/hostlist.php
Log:
sync

Added: GNUnet-docs/WWW/hostlist.php
===================================================================
--- GNUnet-docs/WWW/hostlist.php        2006-04-22 15:01:12 UTC (rev 2625)
+++ GNUnet-docs/WWW/hostlist.php        2006-04-22 15:04:34 UTC (rev 2626)
@@ -0,0 +1,24 @@
+<?php
+// Requires PHP >= 4.3.0
+// Author: "Krasko Oleksandr" <address@hidden>
+// Minor improvements by Christian Grothoff <address@hidden>
+header("Content-Type: application/octet-stream\r\n\r\n");
+$extmas = array('6','8','12','17','23','25');
+$path = '/var/lib/GNUnet/data/hosts/'; // adjust as necessary
+$dir = opendir($path);
+if (! $dir)
+  die("Cannot open directory $path.\n");
+$mas = array();
+while ($fname = readdir($dir)) {
+  if (is_file($path . '/' . $fname)) {
+    $dpo = strpos($fname, '.') + 1;
+    $len = strlen($fname);
+    if (in_array(substr($fname, $dpo - $len, $extmas)) {
+      $mas[] = $fname;
+    }
+  }
+}
+shuffle($mas); // randomize order
+foreach ($mas as $val) 
+  echo file_get_contents($val);
+?>





reply via email to

[Prev in Thread] Current Thread [Next in Thread]