|
Posted by Ben Bullock on May 18, 2006, 11:18 pm
Please log in for more thread options
>
>> 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.
|