5 Tento skript vam umozni vyhledavat a automaticky stahovat
6 multimedialni obsah parsovanim z vyhledavaciho enginu jyxo.cz.
9 function url2filename($url) {
10 $url = explode("/", $url);
11 return $url[(sizeof($url)-1)];
13 //die(url2filename("http://johnys-pages.wbs.cz/03_-_Bob_Marley_-_No_woman_no_cry.mp3")); //Debug
15 function jyxo_bot($q="",$d="mm",$ereg=".",$notereg="",$cnt=10000000000000,$page=1,$pmax=2,$o="nocls") {
20 //$q = str_replace(" ", "+", $q);
22 for(;$page<=$pmax;$page++
) {
23 $request = ("http://jyxo.cz/s?q=$q&d=$d&o=$o&cnt=$cnt&page=$page");
24 $fp = fopen($request, "r") or die(" !!! Cannot connect !!!");
27 if(eregi("<div class='r'>", $line) && ereg(" class=ri", $line)) {
28 $line = explode("<!--m--><div class='r'><A HREF=\"", $line);
30 $line = explode("\" class=ri", $line);
31 $line = trim($line[0]);
32 $line = urldecode($line);
34 if(@eregi
($ereg, $line) && !@eregi
($notereg, $line) && !in_array($line, $results)) {
35 echo("$line\n"); //Output
36 //echo("$i:$line\n"); //Indexed Output
37 //echo("<a href=\"$line\">$line</a><br />\n"); //XHTML Output
46 echo("\nTotal: $i\n"); //Sumary Output
51 function download_url_array($results, $download_dir) {
52 //$download_dir = $GLOBALS["download_dir"];
53 $fails = 0; $done = 0;
54 echo("\nDownloading to $download_dir ...\n");
55 if(!is_dir($download_dir)) {
56 echo("Creating directory: $download_dir\n\n");
58 } else { echo("\n"); }
59 foreach($results as $id => $url) {
60 $file = url2filename($url);
61 echo("Downloading $file (#$id)... ");
62 $file = "$download_dir\\$file";
63 if(!is_file($file) && @copy
($url, $file)) {
67 if(is_file($file)) { echo("File already exists "); }
72 $totaldls = ($fails+
$done);
73 echo("\n$done/$totaldls files successfully downloaded to $download_dir ($fails failed)\n");
76 ///CODE//////////////////////////////////////////////////////////////////////////////////////
77 $results = jyxo_bot("xavier baumaxa","mm","(.mp3|.ogg)",""); //Text2Search
78 //print_r($results); //Array Output
79 //var_dump($results); //Detail debug output
80 //download_url_array($results, "X:\\JyxoBot"); //Automatic Download
This page took 0.402948 seconds and 4 git commands to generate.