473,473 Members | 1,776 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

google SOAP API

HI all
I'm writing a script to search google. The google SOAP API only allows
it to return 10 results . I have the script returning 10 result but i
want it it return the top 100 . Does anyone have a way around this?
Thanks

Nov 5 '06 #1
7 2162
On 5 Nov 2006 07:49:00 -0800, "Damo_Suzuki" <zu****@b00mb0x.orgwrote:
>I'm writing a script to search google. The google SOAP API only allows
it to return 10 results . I have the script returning 10 result but i
want it it return the top 100 . Does anyone have a way around this?
Presumably issue another 9 requests for the remaining 90 results with
different "start" parameters.

--
Andy Hassall :: an**@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Nov 5 '06 #2
how would i go about that. this is the code i have

# Set parameters
$parameters = array(
'key'=>'xxxxxxxxxxxxxxxxxxxxxxxxxx',
'q' =$queryterm,
'start' ='0',
'maxResults' ='10',
'filter' ='false',
'restrict' ='',
'safeSearch' ='false',
'lr' ='',
'ie' ='latin',
'oe' ='latin'
);

# Create a new SOAP client, feeding it GoogleSearch.wsdl on Google's
site
$soapclient = new soapclient('http://api.google.com/GoogleSearch.wsdl',
'wsdl');

# query Google
$results = $soapclient->call('doGoogleSearch',$parameters);

# Results?
if ( is_array($results['resultElements']) ) {
print "<p>Your Google query for '" . $queryterm . "' found "
.. $results['estimatedTotalResultsCount'] . " results, the top ten of
which
are:</p>";
foreach ( $results['resultElements'] as $result ) {
print
"<p><a href='" . $result['URL'] . "'>" .
( $result['title'] ? $result['title'] : 'no title' ) .
"</a><br />" . $result['URL'] . "<br />" .
( $result['snippet'] ? $result['snippet'] : 'no snippet' ) .
"</p>";
}
}

# No Results
else {
print "Your Google query for '" . $queryterm. "' returned no
results";
}
?>

Nov 5 '06 #3
In message <11*********************@f16g2000cwb.googlegroups. com>
"Damo_Suzuki" <zu****@b00mb0x.orgwrote:
>how would i go about that. this is the code i have

# Set parameters
$parameters = array(
'key'=>'xxxxxxxxxxxxxxxxxxxxxxxxxx',
'q' =$queryterm,
'start' ='0',
'maxResults' ='10',
Change the 10 to 100 in this line

--
Kev Wells http://kevsoft.topcities.com
http://kevsoft.co.uk/
ICQ 238580561
Bring me my chariot of fire!
Nov 5 '06 #4
On 5 Nov 2006 08:22:00 -0800, "Damo_Suzuki" <zu****@b00mb0x.orgwrote:
>how would i go about that. this is the code i have

# query Google
$results = $soapclient->call('doGoogleSearch',$parameters);
Rather than just doing one query here, start a loop, and exit when there's no
more results or you've got 100 results.

Each time around, increase $parameters['start'] by 10.

--
Andy Hassall :: an**@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Nov 5 '06 #5
On Sun, 05 Nov 2006 20:32:59 GMT, Kevin Wells <ke********@talktalk.netwrote:
>In message <11*********************@f16g2000cwb.googlegroups. com>
"Damo_Suzuki" <zu****@b00mb0x.orgwrote:
>>how would i go about that. this is the code i have

# Set parameters
$parameters = array(
'key'=>'xxxxxxxxxxxxxxxxxxxxxxxxxx',
'q' =$queryterm,
'start' ='0',
'maxResults' ='10',

Change the 10 to 100 in this line
Won't work, see original message and the Google SOAP API documentation.

--
Andy Hassall :: an**@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Nov 5 '06 #6
**
'start' ='0'
**
means the first page
**
'start' ='10'
**
means the second page

right?

Andy Hassall wrote:
On Sun, 05 Nov 2006 20:32:59 GMT, Kevin Wells <ke********@talktalk.netwrote:
In message <11*********************@f16g2000cwb.googlegroups. com>
"Damo_Suzuki" <zu****@b00mb0x.orgwrote:
>how would i go about that. this is the code i have

# Set parameters
$parameters = array(
'key'=>'xxxxxxxxxxxxxxxxxxxxxxxxxx',
'q' =$queryterm,
'start' ='0',
'maxResults' ='10',
Change the 10 to 100 in this line

Won't work, see original message and the Google SOAP API documentation.

--
Andy Hassall :: an**@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Nov 6 '06 #7
On 6 Nov 2006 05:01:59 -0800, "ju*****@gmail.com" <ju*****@gmail.comwrote:
>**
'start' ='0'
**
means the first page
**
'start' ='10'
**
means the second page

right?
That looks right, yes.

--
Andy Hassall :: an**@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Nov 6 '06 #8

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

Similar topics

0
by: johnsocs | last post by:
All I'm trying to write an xml schema for the following xml from the google web service api. In the schema I'm not sure how to describe the soapenv:encodingStyle attribute. Thanks. <?xml...
2
by: Artur | last post by:
Hi Newsgroup, im currently working on programming a asp.net application consuming an Webservice hosted on Apache/Axis. I have generated WSDL and Proxy classes from VisualStudio.net. But when...
0
by: Jack-of-all-traits | last post by:
Does anyone have more info about the Yahoo API using the SOAP system to automate searches via access ? or even the google API services, which are limited to a mere 1000 searches per 24 hours with...
0
by: tim | last post by:
Hi, I'm playing around with the python external for PureData. (pyext) I want to enable a patch to lookup something on the net. I modified the "search.py" example from Dive Into Python and kind...
4
by: Frank Potter | last post by:
I want to search something by a key word from inside my py script. The using google idea comes to my mind first because write a search programme from scratch is not so easy. I want to take...
0
by: botch | last post by:
Hi! I'm trying to get some help implementing a classic ASP version of the Google API search (http://www.google.com/apis/). I've got a version that works, but it's very sporadic. Sometimes it works,...
4
by: DierkErdmann | last post by:
Hi, I am trying to query google from within a python script using the Google-Api (pygoogle). The following piece of codes gives me a "SOAPpy.Errors.HTTPError: <HTTPError 502 Bad Gateway>", the...
2
by: furrypop | last post by:
Hi, I'm trying to get the Perl SOAP::Lite examples to work on a Windows PC, running Apache 2.2.4. Apache is definitely serving CGI scripts, as I've tested a dummy Hello World thing. I'm also...
0
by: vigneshrao | last post by:
Hi, I have been working on a script that loops through multiple records and sends data (one record per call) to a WS. I am supposed to make a new call for each record before sending the data....
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.