Help Please
Posted: Wed Feb 18, 2004 8:43 pm
Hey guys I thought that would get you too read. I have a script that collects data through google and then processes the data. I have installed the script and it runs but there is no data to process. The script comes back with 0 results. I have manually searched google and get results also this script works on another server, here is the code sniplet. I am not sure exactly what this is doing. Are there permissions that need to be set? Does this script build a txt file for data? What could cause this to give 0 results? Should php.ini be configured a certain way? Apache? This script is ran from command line only.
#Parse the results into an array
preg_match_all("/color=\#008000\>.* - /", $result, $matches);
#$hosts = array();
#$paths = array();
$hostpaths = array();
foreach($matches[0] as $var){
foreach($ignores as $str){
if(eregi($str, $var))
continue 2;
}
$var = str_replace("color=#008000>", "", $var);
$var = preg_replace("/ - .*k -/", "", $var);
if((eregi("\<", $var)) || (eregi("\>", $var)))
continue;
$var = str_replace(" -", "", $var);
$var = str_replace(" ", "", $var);
array_push($hostpaths, $var);
}
echo "\nRetrieved " . count($hostpaths)
#Parse the results into an array
preg_match_all("/color=\#008000\>.* - /", $result, $matches);
#$hosts = array();
#$paths = array();
$hostpaths = array();
foreach($matches[0] as $var){
foreach($ignores as $str){
if(eregi($str, $var))
continue 2;
}
$var = str_replace("color=#008000>", "", $var);
$var = preg_replace("/ - .*k -/", "", $var);
if((eregi("\<", $var)) || (eregi("\>", $var)))
continue;
$var = str_replace(" -", "", $var);
$var = str_replace(" ", "", $var);
array_push($hostpaths, $var);
}
echo "\nRetrieved " . count($hostpaths)