aboutsummaryrefslogtreecommitdiff
path: root/contrib/hostlist.php
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/hostlist.php')
-rw-r--r--contrib/hostlist.php35
1 files changed, 0 insertions, 35 deletions
diff --git a/contrib/hostlist.php b/contrib/hostlist.php
deleted file mode 100644
index 158561542..000000000
--- a/contrib/hostlist.php
+++ /dev/null
@@ -1,35 +0,0 @@
1<?php
2// Requires PHP >= 4.3.0
3// Author: "Krasko Oleksandr" <0m3r.mail@gmail.com>
4// Minor improvements by Christian Grothoff <christian@grothoff.org>
5header("Content-Type: application/octet-stream\r\n\r\n");
6$extmas = array();
7$pv=$_GET['p'];
8if (isset($pv))
9 {
10 for ($ii=0;$ii<64;$ii++)
11 if (0 != ($pv & (1 << $ii)))
12 $extmas[] = $ii;
13 }
14else
15 {
16 $extmas = array('2','3','4','5','6','8','12','17','23','25');
17 }
18$path = '/var/lib/gnunet/data/hosts/'; // adjust as necessary
19$dir = opendir($path);
20if (! $dir)
21 die("Cannot open directory $path.\n");
22$mas = array();
23while ($fname = readdir($dir)) {
24 $fn = $path . '/' . $fname;
25 if (is_file($fn)) {
26 $dpo = strpos($fname, '.') + 1;
27 $len = strlen($fname);
28 if (in_array(substr($fname, $dpo - $len), $extmas))
29 $mas[] = $fn;
30 }
31}
32shuffle($mas); // randomize order
33foreach ($mas as $val)
34 echo file_get_contents($val);
35?>