Get a bird's eye view of all the Perl Mongers by using Mac::Glue to drive Google Earth:
#!/usr/bin/perl
use LWP::Simple;
use Mac::Glue;
print "Downloading Perl Mongers XML file...";
my $data = get( 'http://www.pm.org/groups/perl_mongers.xml' );
$data ? ( print "done\n" ) : ( die "Could not get file!" );
# See Mac::Glue for details on creating the glue, probably:
# gluemac/Applications/Google\ Earth.app
print "Starting Google Earth...";
my $gEarth = Mac::Glue->new( 'Google_Earth' );
$gEarth ? ( print "done\n" ) : ( die "Could not start Google Earth!" );
while( $data =~ m|<group.*?>(.*?)</group>|gs )
{
# I could use an XML parser, but it's too easy to do it myself
my( $name, $long, $lat ) = $1 =~ m|
<name>(.*?)</name>
.*?
<longitude>(.*?)</longitude>
.*?
<latitude>(.*?)</latitude>
|xs;
print "Flying to $name\n";
$gEarth->setviewinfo(
{
'azimuth' => '0',
'longitude' => $long,
'distance' => '4000',
'latitude' => $lat,
'tilt' => '0'
}
);
sleep 15;
}
Way Cool (Score:2)