in reply to Re: Put yourself on the Map -- correction
in thread Put yourself on the Map -- correction
#!/usr/local/bin/perl -w use strict; sub convert { $_ = shift; my $a; my $b; /^([0-9-]+)\.([0-9]+)$/; ($a,$_) = ($1,("0." . $2)*60); /^([0-9-]+)\.([0-9]+)$/; ($b,$_) = ($1, ("0." . $2)*60); s/\..*$//; return "$a.$b.$_"; } while(<stdin>){ my $lat; my $lon; if(/.*&CT=([0-9.-]+)%3A([0-9.-]+).*/){ my $lat = $1; my $lon = $2; print "\n\n<!-- location:latitude=" . convert($lat) . ",longit +ude=" . convert($lon) . " -->\n"; } }
|
---|