Net::Google 502 Bad gateway errors
Net::Google 502 Bad gateway errors
am 17.05.2006 08:15:54 von benkasminbullock
Does anyone here use the Net::Google module? It seems to run very slowly,
and I keep getting "502 Bad gateway" errors. In the end I just downloaded
the search page using libwww and parsed it myself, which is almost instant.
--
sci.lang.japan FAQ: http://www.sljfaq.org/afaq/afaq.html
Re: Net::Google 502 Bad gateway errors
am 18.05.2006 10:41:27 von Henry McGuinness
"Ben Bullock" wrote in message
news:e4ef2p$bnv$1@ml.accsnet.ne.jp...
> Does anyone here use the Net::Google module? It seems to run very slowly,
> and I keep getting "502 Bad gateway" errors. In the end I just downloaded
> the search page using libwww and parsed it myself, which is almost
> instant.
Hi,
I think the "Bad Gateway" stuff is actually a Google api/server problem. I
had this and it was nothing to do with Net::Google or my query. (though you
might have posted some code :)) - I assume you have a google api key, by
the way. I looked at a google api newsgroup and this was a fairly regular
problem
Believe it or not the solution is probably: leave it a couple of minutes and
try again a few times. It does work, but sometimes rather sporadically. I
found the Yahoo api stuff much more reliable. have a look at that:
http://developer.yahoo.com/
Others were having this problem in January and posted some code (though they
were using SOAP::Lite, adjust your code accordingly):
http://groups.google.co.uk/group/google.public.web-apis/brow se_frm/thread/6f1ef9463b961feb/091e5c9505d5f81a?lnk=st&q=goo gle+api+502+bad+gateway&rnum=1&hl=en#091e5c9505d5f81a
cheers
Henry
Re: Net::Google 502 Bad gateway errors
am 19.05.2006 05:18:14 von benkasminbullock
"Henry McGuinness" wrote in message
news:e4hbvp$le9$1@news.ox.ac.uk...
>
> "Ben Bullock" wrote in message
> news:e4ef2p$bnv$1@ml.accsnet.ne.jp...
>> Does anyone here use the Net::Google module? It seems to run very slowly,
>> and I keep getting "502 Bad gateway" errors. In the end I just downloaded
>> the search page using libwww and parsed it myself, which is almost
>> instant.
> I think the "Bad Gateway" stuff is actually a Google api/server problem. I
> had this and it was nothing to do with Net::Google or my query. (though
> you might have posted some code :)) - I assume you have a google api key,
> by the way. I looked at a google api newsgroup and this was a fairly
> regular problem
Yes, I've got one of those.
> Believe it or not the solution is probably: leave it a couple of minutes
> and try again a few times. It does work, but sometimes rather
> sporadically. I found the Yahoo api stuff much more reliable. have a look
> at that: http://developer.yahoo.com/
OK, but what about just putting a search URL together then grabbing the page
via libwww and parsing it using regular expressions though? That works
almost every time, I never get any 502 errors, and the results are virtually
instant. I can't see why I would want to use this Net::Google thing in the
first place.
> Others were having this problem in January and posted some code (though
> they were using SOAP::Lite, adjust your code accordingly):
That is where the error comes in, it gives the line numbers from that code.
I'm not sure I'd want to spend hours fixing it though, because I'm far from
being an expert in Perl and it would take a lot of time for me to do so. I
suppose the nature of my question was to try to find out why anyone would
use Net::Google when it seems to endlessly choke and run very slowly, and
it's easy to get the stuff from Google via another method.
Re: Net::Google 502 Bad gateway errors
am 19.05.2006 05:39:40 von John Bokma
"Ben Bullock" wrote:
> Does anyone here use the Net::Google module? It seems to run very
> slowly, and I keep getting "502 Bad gateway" errors.
Yes, blame it on Google. I read similar complaints in the python
newsgroup, and I replied there with: just retry.
Somehow the API is quite unstable on Google's side for at least the past
two weeks. About 3 weeks ago I couldn't even access the wsdl file most of
the times.
--
John Bokma Freelance software developer
&
Experienced Perl programmer: http://castleamber.com/
Re: Net::Google 502 Bad gateway errors
am 19.05.2006 05:42:28 von John Bokma
"Henry McGuinness" wrote:
> Others were having this problem in January and posted some code
> (though they were using SOAP::Lite, adjust your code accordingly):
Net::Google uses SOAP::Lite, so that's probably not changing a single
thing :-)
OTOH, I suspect that the latest Net::Google has some bugs regarding
booleans, and hence some options are always on (or off, can't recall).
I haven't had time to look into this further, but it you notice odd
results, you might want to check what Net::Google is making SOAP::Lite do
(IIRC there is a lot of hacking going in order to talk to SOAP::Lite)
--
John Bokma Freelance software developer
&
Experienced Perl programmer: http://castleamber.com/
Re: Net::Google 502 Bad gateway errors
am 19.05.2006 12:29:19 von Henry McGuinness
"Ben Bullock" wrote in message
news:e4jddl$h67$1@ml.accsnet.ne.jp...
> "Henry McGuinness" wrote in message
> news:e4hbvp$le9$1@news.ox.ac.uk...
>> Believe it or not the solution is probably: leave it a couple of minutes
>> and try again a few times. It does work, but sometimes rather
>> sporadically. I found the Yahoo api stuff much more reliable. have a look
>> at that: http://developer.yahoo.com/
>
> OK, but what about just putting a search URL together then grabbing the
> page via libwww and parsing it using regular expressions though? That
> works almost every time, I never get any 502 errors, and the results are
> virtually instant. I can't see why I would want to use this Net::Google
> thing in the first place.
Maybe, but watch google's terms of service on this. They don't like
"automated queries" and are not specific about all the types of query this
includes: http://www.google.co.uk/intl/en/terms_of_service.html
>
>> Others were having this problem in January and posted some code (though
>> they were using SOAP::Lite, adjust your code accordingly):
>
> That is where the error comes in, it gives the line numbers from that
> code.
Yes. What I meant was you'll have to change their SOAP::Lite syntax to the
Net::Google query you want to do so you'll have:
....do {
#your Net::Google search here instead of the doGoogleSearch stuff...
if ( $@ ) { ......
cheers
Henry
Re: Net::Google 502 Bad gateway errors
am 21.05.2006 09:03:37 von benkasminbullock
"Henry McGuinness" wrote in message
news:e4k6m1$lcf$1@news.ox.ac.uk...
>
> "Ben Bullock" wrote in message
> news:e4jddl$h67$1@ml.accsnet.ne.jp...
>> "Henry McGuinness" wrote in message
>> news:e4hbvp$le9$1@news.ox.ac.uk...
>
>>> Believe it or not the solution is probably: leave it a couple of minutes
>>> and try again a few times. It does work, but sometimes rather
>>> sporadically. I found the Yahoo api stuff much more reliable. have a
>>> look at that: http://developer.yahoo.com/
>>
>> OK, but what about just putting a search URL together then grabbing the
>> page via libwww and parsing it using regular expressions though? That
>> works almost every time, I never get any 502 errors, and the results are
>> virtually instant. I can't see why I would want to use this Net::Google
>> thing in the first place.
>
> Maybe, but watch google's terms of service on this. They don't like
> "automated queries" and are not specific about all the types of query this
> includes: http://www.google.co.uk/intl/en/terms_of_service.html
I'm guessing that would be more directed at people like scroogle
(http://www.scroogle.org/) than someone like me, who's unlikely to download
more than 100 pages a day.