Re: Net::Google 502 Bad gateway errors




"Ben Bullock" <benkasminbullock@xxxxxxxxx> wrote in message
news:e4jddl$h67$1@xxxxxxxxxxxxxxxxxxx
"Henry McGuinness" <henry.mcguinness@xxxxxxxxxxxxxx> wrote in message
news:e4hbvp$le9$1@xxxxxxxxxxxxxxxx

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


.