On Mar 3, 2012, at 12:59 PM, Rich Shepard wrote:

> On Sat, 3 Mar 2012, wes wrote:
> 
>> this strongly suggests a problem at the other end, at whatismyip.com.
>> perhaps resulting from load related issues. there are a lot of people
>> using it in this way. I wonder if your dynamic IP host has any equivalent
>> service to offer you?
> 
> wes,
> 
>   You are correct that the problem is at their end:
> 
> <html><body><h1> HTTP/1.1 500 Server Error</h1></body></html>
> 50.43.7.160
> 
>   Saw several of these starting at 11:30am. I'll move the query to 7 after
> the quarter hours and see if that avoids the rush hour crowds.
> 
I'm sure somebody can write this neater, but you could use something like this:

#!/usr/bin/env perl

use warnings;
use strict;
use LWP::Simple;

my $external_ip = "";

sub external_loc_func () {
        my @fields = "";
        my $location = "unknown";
        $external_ip = get 'http://www.hostip.info/';
        my @ext_ip_arr = split ('\n', $external_ip );
        foreach my $line ( @ext_ip_arr ) {
                if ( $line =~ /IP address:/ ) {
                        @fields = split ( '\s+', $line );
                        @fields = split ( /<?..>/, $fields[3] );
                        $external_ip = $fields[1];
                }
        }
}
external_loc_func;
print "External IP: $external_ip\n";



--
Louis Kowolowski                                [email protected]
Cryptomonkeys:                      http://www.cryptomonkeys.org/~louisk

Making life more interesting for people since 1977

_______________________________________________
PLUG mailing list
[email protected]
http://lists.pdxlinux.org/mailman/listinfo/plug

Reply via email to