getafile($query,'GET'); //astound_log($query); //astound_log($check); if (empty($check)) return false; if (strpos($check,'yes')===false) return false; $lastseen=''; $frequency=''; if (strpos($check,'',$n)!==false) { $k=strpos($check,'',$n); $k+=10; $j=strpos($check,'',$k); $lastseen=date('Y-m-d',time()); if (($j-$k)>12&&($j-$k)<24) $lastseen=substr($check,$k,$j-$k); // should be about 20 characters if (strpos($lastseen,' ')) $lastseen=substr($lastseen,0,strpos($lastseen,' ')); // trim out the time to save room if (strpos($check,'',$n)!==false) { $k=strpos($check,'',$n); $k+=11; $j=strpos($check,'=$freq) && (strtotime($lastseen)>(time()-(60*60*24*$maxtime))) ) { if ( ($frequency>=$sfsfreq) && (strtotime($lastseen)>(time()-(60*60*24*$sfsage))) ) { // frequency we got from the db, sfsfreq is the min we'll accept (default 0) // sfsage is the age in days - we get lastscene from return "SFS last seen=$lastseen, frequency=$frequency"; } return false; } public static function getafile($f,$method='GET') { // try this using Wp_Http if( !class_exists( 'WP_Http' ) ) include_once( ABSPATH . WPINC. '/class-http.php' ); $request = new WP_Http; $parms=array(); $parms['timeout']=10; // bump timeout a little we are timing out in Google $parms['method']=$method; $result = $request->request( $f ,$parms); // see if there is anything there if (empty($result)) return ''; if (is_array($result)) { $ansa=$result['body']; return $ansa; } if (is_object($result) ) { $ansa='ERR: '.$result->get_error_message(); return $ansa; // return $ansa when debugging // return ''; } return ''; } } ?>