", $line) && ereg(" class=ri", $line)) { $line = explode("
$line
\n"); //XHTML Output $results[$i] = $line; $i++; } } } fclose($fp); } echo("\nTotal: $i\n"); //Sumary Output return $results; } // function download_url_array($results, $download_dir) { //$download_dir = $GLOBALS["download_dir"]; $fails = 0; $done = 0; echo("\nDownloading to $download_dir ...\n"); if(!is_dir($download_dir)) { echo("Creating directory: $download_dir\n\n"); mkdir($download_dir); } else { echo("\n"); } foreach($results as $id => $url) { $file = url2filename($url); echo("Downloading $file (#$id)... "); $file = "$download_dir\\$file"; if(!is_file($file) && @copy($url, $file)) { echo("Done.\n"); $done++; } else { if(is_file($file)) { echo("File already exists "); } echo("Failed!\n"); $fails++; } } $totaldls = ($fails+$done); echo("\n$done/$totaldls files successfully downloaded to $download_dir ($fails failed)\n"); } ///CODE////////////////////////////////////////////////////////////////////////////////////// $results = jyxo_bot("interpret titul","mm","(.mp3|.ogg)"); //Text2Search //print_r($results); //Array Output //var_dump($results); //Detail debug output //download_url_array($results, "X:\\JyxoBot"); //Automatic Download ?>