Search the Community
Showing results for tags 'lwp'.
-
Hello I am on 'stevie' and want to retrieve some data from 'Google - maps.googleapis.com'. I use LWP::UserAgent. From heliohost.org the download works sometimes but most of the times it does not. The 'response->status_line' is: 500 Can't connect to maps.googleapis.com:80 The strange thing is, when it works at some point it works for a while and then stops working again. With other tested url's it's working without any issues. The url works from the browser and with wget without any problems. The snipplet of the program is: #!/usr/bin/perl -wT use strict; use warnings; require LWP::UserAgent; print "Content-type: text/html\n\n"; my $ua = LWP::UserAgent->new; $ua->timeout(5); my $response = $ua->get('http://maps.googleapis.com/maps/api/directions/xml?origin=49.29,-123.13&destination=49.32,-123.12'); print $response->status_line; print "<br>"; if ($response->is_success) { my @googleResponse = $response->decoded_content; print qq(success<br>); print qq(@googleResponse); print "<br>"; } else { print qq(err_timeout<br>); } ... and its uploaded to: http://islander.heli...gi-bin/test.cgi Any help would be greatly appreciated.