newer version of HarveCter + some funny php scripts
[mirrors/Programs.git] / php / torrentbot.php
diff --git a/php/torrentbot.php b/php/torrentbot.php
new file mode 100644 (file)
index 0000000..c69bc4c
--- /dev/null
@@ -0,0 +1,24 @@
+<pre>
+<h1>Torrent Search Bot</h1>
+<form action="?" method="GET">
+       <input type="text" name="q"><input type="submit" value="!SearchNow!">
+</form>
+
+<?php
+set_time_limit(0); 
+
+if(!isset($_GET['q'])) die('</pre>');
+$q = $_GET['q'];
+
+$q = urlencode($q);
+$q = "http://www.google.com/search?num=100&q=$q%20filetype%3Atorrent";
+echo("<a href=\"$q\">$q</a>\n\n");
+
+preg_match_all('(http:\/\/[_a-zA-Z0-9\.\-]+\.[a-zA-Z]{2,4}\/{1}[-_~&=\ ?\.a-z0-9\/]*)',htmlspecialchars_decode(@file_get_contents($q)), $torrents);
+//print_r($torrents);
+$torrents = $torrents[0];
+foreach($torrents as $torrent) if(eregi('\.torrent', $torrent)){
+       echo("<a href=\"$torrent\">$torrent</a>\n");
+}
+?>
+</pre>
This page took 0.091266 seconds and 4 git commands to generate.