Snoopy help ..

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Hi guys, I'm playing with snoopy and am stuck on doing two calls in the same  
script. The second call revisits a website after getting an existing link  
based on the results of the first call ... If I hard code the URL, then  
everything is fine. It's this line that goes wrong  
"$newsnoopy->fetchtext($newurl);" ... If I put  
$newsnoopy->fetchtext(http://result/of/first/call/); It's fine. Any help  

error ...  "BAD REQUESTYour client sent a request that this server didn't  
understand.Request: "


$snoopy = new Snoopy();
$url = " =".$_GET['inputpc'];;
$snoopy->agent = "Mozilla/8.0";

$newurl = $snoopy->results[38];;

$newsnoopy = new Snoopy();
$newsnoopy->agent = "Mozilla/8.0";
$newsnoopy->fetchtext(" /"); // this works
//$newsnoopy->fetchtext($newurl);                        // this doesn't
//$newsnoopy->fetchtext($snoopy->results[38]);    // this doesn't

echo $newurl."<br>";
//echo $newsnoopy->results;

$exploded=explode(" ",$newsnoopy->results);
echo $exploded[42];
echo "<br>";
echo $exploded[51];


Re: Snoopy help ..

Quoted text here. Click to load it

Thanks to any that read this. I viewed the output source and therer was an  
&amp; instead of an & in the URL.

$newurl = str_replace("&amp;", "&", $newurl);


Re: Snoopy help ..

Stick in a debug output to show you what $newurl is being set as, so
you can see if its a properly formatted url.


Quoted text here. Click to load it

Re: Snoopy help ..

Quoted text here. Click to load it
Thanks, it did turn out to be a badly formatted variable.  

Site Timeline