Can the number of results returned, be increased from 10 to something
else.Is that possible
please
Thanks
Kimmy
Regards
Gurpreet
singhgur...@hotmail.com
While increasing the results returned would be nice, you can get around
it by incrementing the start point and combining your results. For
example:
for(my $i = 0; $i < 10; $i++) {
my $result = $google->doGoogleSearch($key, $query, $i, 10, 'false', '',
'false', '', 'UTF-8', 'UTF-8');
...push, or something...
}
This cuts your number of available queries in a day by 10 (in this
case), but what do you expect for free?
-
thor.
Sorry for the language
Regards
Gurpreet
//////////////////////////////////////////code//////////////////////////////////////////////////////////////////////
// Create a Google Search object
WebReference.GoogleSearchService s = new
WebReference.GoogleSearchService();
int start=0;
int maxresults=10;
while (start <= 100)
{
try
{
// Invoke the search method
//results retrieved cannot be greater than 10 per query
WebReference.GoogleSearchResult r = s.doGoogleSearch(licenseBox.Text,
keywordBox.Text, start, maxresults, false, "", false, "", "", "");
// Extract the estimated number of results for the search and display
it
int estResults = r.estimatedTotalResultsCount;
this.numberOfResultBox.Text = Convert.ToString(estResults);
//Adding URLs received form google to queryResult ListBox
for (int i = start; i < (start + maxresults); i++)
{
this.queryResult.Items.Add(r.resultElements[i].URL.ToString());
}
no_of_queries++;
this.queryBox.Text = Convert.ToString(no_of_queries);
}
catch (System.Web.Services.Protocols.SoapException ex)
{
this.statusBox.Text = ex.Message;
}
catch (Exception ex)
{
this.statusBox.Text = ex.Message;
}
start = start + 10;
}
That seems great, have you done this, can I see it in action.
Thanks for your help
Kimmy