Tutorials Infos - Anleitungen - Hilfe - Dreamcodes
 

Domain sucher

 Dieses Programm durchsucht den rdf-Dump des DMOZ directories
 nach Domains einer bestimmten Endung.  Aber vorsicht, es handelt sich um 500 MB an domains und es  können je nach Domain-Typ Hundertausende Domains gefunden  werden.  Empfehlung: nur via Kommandozeile Starten!

Script:
<?php
  /* ------------ CONFIGURATION --------------*/

   // Domain extension to search for.
   // Finds domains like yourname.de
   $conf_domain = "de";

   // File the results are written to
   // (needs to be writable)
   $conf_fname = "domains.txt";

   // DMOZ Rdf File
   // Location from where to retrieve the dump.
   // (There are also mirrors)
   $conf_rdf = "http://rdf.dmoz.org/rdf/content.rdf.u8.gz";


   /* --------------PROGRAM CODE---------------*/
   // Let the script run as long as needed
   // Attention: Safe-Mode needs to be disabled
   ini_set("max_execution_time","0");

   // Wget needs to be installed in order to work
   $fp = popen("wget --progress=0 -O - $conf_rdf | gunzip","r");
   $fres = fopen($conf_fname,"w");

   $regex1 = '="http://([^"/:]+)';
   $regex2 = '.+.(.+.'.$conf_domain.')$';

   while (!feof($fp))
   {
      $buffer = fgets($fp);

      if (eregi($regex1,$buffer,$match1))
      {
         if (eregi($regex2,$match1[1],$match2))
         {
            // success!
            $domain = $match2[1];
            fwrite($fres, $domain."n");
         }
      }
   }
?>

 
ID: 574
eingestellt am: 12.12.2004
Autor: pantufle
Status zum lesen: Gast
gelesen: 7066
Webseite: www.dreamcodes.com
[Drucken]