473,395 Members | 1,941 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Snoopy help ..

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
appreciated....

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

<?php
include("Snoopy-1.2/Snoopy.class.php");

$snoopy = new Snoopy();
$url = "http://www.thefirsturl.com/?name=".$_GET['inputpc'];;
$snoopy->agent = "Mozilla/8.0";
$snoopy->fetchlinks($url);

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

$newsnoopy = new Snoopy();
$newsnoopy->agent = "Mozilla/8.0";
$newsnoopy->fetchtext("http://www.thesecondurl.com/"); // 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];
?>
Aug 9 '05 #1
3 2399

"elyob" <ne*********@gmail.com> wrote in message
news:42********@news1.homechoice.co.uk...
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
appreciated....


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);
Sorted.

Aug 9 '05 #2
Stick in a debug output to show you what $newurl is being set as, so
you can see if its a properly formatted url.
On Tue, 9 Aug 2005 16:28:12 +0100, "elyob" <ne*********@gmail.com>
wrote:
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
appreciated....

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

<?php
include("Snoopy-1.2/Snoopy.class.php");

$snoopy = new Snoopy();
$url = "http://www.thefirsturl.com/?name=".$_GET['inputpc'];;
$snoopy->agent = "Mozilla/8.0";
$snoopy->fetchlinks($url);

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

$newsnoopy = new Snoopy();
$newsnoopy->agent = "Mozilla/8.0";
$newsnoopy->fetchtext("http://www.thesecondurl.com/"); // 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];
?>

Aug 9 '05 #3

"M.Waters" <no*@a.chance> wrote in message
news:fp********************************@4ax.com...
Stick in a debug output to show you what $newurl is being set as, so
you can see if its a properly formatted url.

Thanks, it did turn out to be a badly formatted variable.
Aug 9 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
by: Stefan Richter | last post by:
Hi, I would like to conect to a server by a SSL Conection, to send an SMS. The company that offers the SMS service provided some Code for a http connection, but not for a https connection. Here...
6
by: toby casey | last post by:
Dear all, I am brand new to php, but learning quickly. I need to be able to go to website, obtain the form elements, cycle through the form elements, fetch the links for each page that results...
0
by: ChronoFish | last post by:
Hello, Snoopy is reporting: Warning: MagpieRSS: Failed to fetch http://some.domain.com/atom.xml. (HTTP Response: HTTP/1.0 407 Proxy Authentication Required ) in \web\rss\magpie\rss_fetch.inc...
4
by: futureofphp | last post by:
I need to access a website, Fetch the data, and then logout. Please tell me where I am wrong. I dont think its logging out properly. <? include "Snoopy.class.php"; $snoopy = new Snoopy; ...
10
by: brett | last post by:
I have a file named Snoopy.class.php on my hosted web server in a directory called d:\home\ABC.COM\blog\wp-content\plugins\ A file named dahnielson_mimetex.php references it. However, when...
1
by: f3l | last post by:
need snoopy samples for file POST upload
3
by: Bartholomew Simpson | last post by:
I need to pack two small values into a double data type. I have come up with the following struct, which only takes up 16 bits and can therefore be stored safely in a double. struct mytype_ {...
0
by: regisma | last post by:
Hi, I will like to use Snoopy class to check the rate and the price to ship a box with Fedex. I have begun with this code but I cannot do domething usefull with it yet. Can someone can...
2
by: jeddiki | last post by:
Hello, I want to create my own index of websites based on my criteria rather than big G's. For example, I might like to index websites according to what they have in their "author" Meta tag (...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.