Google API using SOAP Lite doesn"t like "&" in query

Google API using SOAP Lite doesn"t like "&" in query

am 29.06.2005 23:06:35 von mccownf

Maybe someone knows why the Google API is having problems when the '&'
char appears in a query. This is necessary when trying to find out
info about a URL as the code below demonstrates.

my $query =
'http://www.duexotictimbers.com/gallerydisplay.aspx?cat=bowl s&test=1';
my $google_search = SOAP::Lite->service("file:GoogleSearch.wsdl");
my $results = $google_search ->
doGoogleSearch(
$google_key, $query, 0, 10, "false", "", "false",
"", "latin1", "latin1");
@{$results->{resultElements}} or exit;

The last line causes this run-time error:

Can't use an undefined value as an ARRAY reference at ...

Any ideas how this problem can be fixed? I tried replacing the & with
%26 but then Google can't find the site.

Thanks,
Frank

Re: Google API using SOAP Lite doesn"t like "&" in query

am 30.06.2005 13:55:26 von mccownf

The $query from the previous post should have been

my $query = 'info:http://...etc...';

Frank

Re: Google API using SOAP Lite doesn"t like "&" in query

am 30.06.2005 14:04:34 von Thomas Wittek

> Any ideas how this problem can be fixed? I tried replacing the & with
> %26 but then Google can't find the site.

Did you try to replace the & by a ; ?
This might work.

-Thomas

Re: Google API using SOAP Lite doesn"t like "&" in query

am 30.06.2005 17:21:49 von mccownf

I think I found the problem. Since this is being converted into a SOAP
query (XML), the '&' char must be converted in '&'. The & is
then converted back into a '&' char when performing the actual query.

This also applied to using the Net::Google module. An automatic
conversion of these chars would be nice to have done.

Frank

Re: Google API using SOAP Lite doesn"t like "&" in query

am 30.06.2005 20:04:01 von mccownf

Argh... If you are viewing this in a web browser, you're not seeing the
actual chars I posted. The previous post is talking about converting
the '&' char into the '&' char.