|
-
Jun 1st, 2006, 09:43 AM
#1
Thread Starter
Addicted Member
[RESOLVED] Opening $_GET urls?
Hi y'all,
I want to extract data from Google in a specific search.
But when I use
PHP Code:
$filename = "http://www.google.com/search?hl=en&q=$somequery";
$handle = fopen($filename, "r");
$contents = fread($handle, filesize($filename));
fclose($handle);
echo $contents;
I get the error:
Warning: fopen("http://www.google.com/search?hl=en&q=(somequery)", "r") - No error in c:\apache\htdocs\intranet\revision_a\getdata.php on line 100
Warning: stat failed for http://www.google.com/search?hl=en&q=(somequery) (errno=2 - No such file or directory) in c:\apache\htdocs\intranet\revision_a\getdata.php on line 101
-
Jun 1st, 2006, 12:25 PM
#2
Re: Opening $_GET urls?
You should be using Google's API as what you're trying to do is against their policy and if your script does it alot, you could get banned from Google (or at least your server).
-
Jun 1st, 2006, 01:25 PM
#3
<?="Moderator"?>
Re: Opening $_GET urls?
http://www.google.com/api
You need to get a free serial and then your good to go, to use it with PHP you need to have access to a SOAP library, either through pear, or buy using nusoap from sf. There are others out their but i recommend nusoap, haven't had any problems yet.
-
Jun 1st, 2006, 01:26 PM
#4
Re: Opening $_GET urls?
Look into using SOAP. PHP 5 has an extension and PEAR also has an implementation.
-
Jun 2nd, 2006, 06:20 AM
#5
Thread Starter
Addicted Member
Re: Opening $_GET urls?
Ok, thx.
I thought that no rule was broken because it's just a simple HTTP request.
-
Jun 2nd, 2006, 08:29 AM
#6
Re: [RESOLVED] Opening $_GET urls?
Yuh, but it's an automated request.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|