From robert.l.harris at gmail.com Wed Mar 12 09:00:51 2014 From: robert.l.harris at gmail.com (Robert L. Harris) Date: Wed, 12 Mar 2014 10:00:51 -0600 Subject: [Denver-pm] Perl GPS->kml? Message-ID: I'm working on a log parser at work which reads in GPS data. I'm looking to use the Geo::KML module to output some data into a kml file. Unfortunately this is a new area and I am not having much luck finding valid examples I can learn from. Does anyone have a source which might show me how to map data with notations? Thanks, Robert -- :wq! --------------------------------------------------------------------------- Robert L. Harris DISCLAIMER: These are MY OPINIONS With Dreams To Be A King, ALONE. I speak for First One Should Be A Man no-one else. - Manowar -------------- next part -------------- An HTML attachment was scrubbed... URL: From geovanny at eutsiv.com Wed Mar 12 09:09:16 2014 From: geovanny at eutsiv.com (Geovanny Junio :: eutsiv) Date: Wed, 12 Mar 2014 13:09:16 -0300 Subject: [Denver-pm] Perl GPS->kml? In-Reply-To: References: Message-ID: Hi Robert, I have never used Geo::KML module, but as suggested on docs, you can run the following code, using the .kml files found in this link http://code.google.com/apis/kml/documentation/kmlreference.html use Geo::KML; my $data = Geo::KML->readKML("example.kml"); use Data::Dumper; $Data::Dumper::Indent = 1; print Dumper $data; So you can analyze the output data of Data::Dumper and understand how to structure your data. Cheers, -- Geovanny Junio Consultor de Tecnologia geovanny (at) eutsiv.com +55 31 9422-8885 +55 31 2519-8603 www.eutsiv.com Este e-mail pode conter informa??o privilegiada e confidencial. Se voc? n?o ? destinat?rio da mensagem, por favor apague a mensagem e comunique-nos o fato de imediato. This e-mail contains information that may be privileged and confidential. If you are not the intended recipient, please delete the e-mail and notify us immediately. On Wed, Mar 12, 2014 at 1:00 PM, Robert L. Harris wrote: > > I'm working on a log parser at work which reads in GPS data. I'm looking > to use the Geo::KML module to output some data into a kml file. > Unfortunately this is a new area and I am not having much luck finding > valid examples I can learn from. Does anyone have a source which might > show me how to map data with notations? > > Thanks, > Robert > > > -- > :wq! > --------------------------------------------------------------------------- > Robert L. Harris > > DISCLAIMER: > These are MY OPINIONS With Dreams To Be A King, > ALONE. I speak for First One Should Be A Man > no-one else. - Manowar > > _______________________________________________ > Denver-pm mailing list > Denver-pm at pm.org > http://mail.pm.org/mailman/listinfo/denver-pm > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.l.harris at gmail.com Thu Mar 20 08:19:58 2014 From: robert.l.harris at gmail.com (Robert L. Harris) Date: Thu, 20 Mar 2014 09:19:58 -0600 Subject: [Denver-pm] Simplifying Time? Message-ID: I'm running a script that is adding up the duration of events. By the end of it I have something like this: $Days=5 $Hours=131 $Mins=618 $Secs=151 Anyone know a simple modules to simplify this to standard ranges? Even if I have to do a multi-step? I've looked into a few options but none are 'clean.' Robert -- :wq! --------------------------------------------------------------------------- Robert L. Harris DISCLAIMER: These are MY OPINIONS With Dreams To Be A King, ALONE. I speak for First One Should Be A Man no-one else. - Manowar -------------- next part -------------- An HTML attachment was scrubbed... URL: From jay at jays.net Thu Mar 20 08:37:39 2014 From: jay at jays.net (Jay Hannah) Date: Thu, 20 Mar 2014 10:37:39 -0500 Subject: [Denver-pm] Simplifying Time? In-Reply-To: References: Message-ID: On Mar 20, 2014, at 10:19 AM, Robert L. Harris wrote: > I'm running a script that is adding up the duration of events. By the end of it I have something like this: > > $Days=5 > $Hours=131 > $Mins=618 > $Secs=151 > > Anyone know a simple modules to simplify this to standard ranges? Even if I have to do a multi-step? I've looked into a few options but none are 'clean.' The defacto thing everyone and their mom uses is DateTime: https://metacpan.org/pod/DateTime I find it pretty meh for some things, so I used to use Class::Date a ton at a previous job: https://metacpan.org/pod/distribution/Class-Date/Date.pod # creating relative date object # (normally you don't need to create this object explicitly) my $reldate = new Class::Date::Rel "3Y 1M 3D 6h 2m 4s"; It's been a while since I hacked on this stuff hard. :) j Omaha.pm From jay at jays.net Thu Mar 20 09:23:47 2014 From: jay at jays.net (Jay Hannah) Date: Thu, 20 Mar 2014 11:23:47 -0500 Subject: [Denver-pm] Simplifying Time? In-Reply-To: References: Message-ID: On Mar 20, 2014, at 11:06 AM, Robert L. Harris wrote: > It looks like the reldate is what I want, not figure out how to use it. No clear examples on "convert 561 seconds to 9 minutes, 21 seconds" :) Does this help? https://github.com/jhannah/sandbox/blob/master/robertlharris/go.pl $ cat go.pl use Class::Date; use 5.10.0; my $reldate = new Class::Date::Rel "561s"; say "In minutes: " . $reldate->min; say "In seconds: " . $reldate->sec; my $seconds_only = $reldate - (int($reldate->min) * 60 . 'm'); # subtract minutes away say "Seconds only: $seconds_only"; printf("%d minutes %d seconds\n", int($reldate / 60), $seconds_only); $ perl go.pl In minutes: 9.35 In seconds: 561 Seconds only: 21 9 minutes 21 seconds j From jay at jays.net Thu Mar 20 10:56:02 2014 From: jay at jays.net (Jay Hannah) Date: Thu, 20 Mar 2014 12:56:02 -0500 Subject: [Denver-pm] Fwd: Simplifying Time? References: Message-ID: <8F8EC04B-1873-4988-8EFD-8FECF986D2DD@jays.net> FYI, Denver folk. :) Begin forwarded message: > From: Sterling Hanenkamp > Subject: Re: [Omaha.pm] Simplifying Time? > Date: March 20, 2014 at 12:52:57 PM CDT > To: "Perl Mongers of Omaha, Nebraska USA" > Reply-To: "Perl Mongers of Omaha, Nebraska USA" > > If you use DateTime instead of Class::Date, there's the DateTime::Duration class which will let you add durations: > > my $duration = DateTime::Duration->new( seconds => 15 ); > $duration->add( seconds => 73 ); > $duration->add( weeks => 12 ); > > There are some modules to help with formatting durations too. I think the nicest of which is this one: > > https://metacpan.org/pod/DateTime::Format::Human::Duration > > It's a pretty nice module. > > -- > Andrew Sterling Hanenkamp > sterling at hanenkamp.com > 785.370.4454 -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.l.harris at gmail.com Fri Mar 21 10:11:07 2014 From: robert.l.harris at gmail.com (Robert L. Harris) Date: Fri, 21 Mar 2014 11:11:07 -0600 Subject: [Denver-pm] Sample HTTP interaction script. Message-ID: I need to throw something simple together real quick. A one-timer that SHOULDN"T be re-used... I need to connect to a site, http://foo.bar:/8052/Login.html I am then prompted for a login/password. Once I log in I am given a new page : http://foo.bar:8052/App.html On this page is a search box, amongst other things, I want to put in a value (user filled variable) and post the search. Then scrape the resulting page for a result. I have done basic auth using apache auth but this is the app requiring a login using a backend database. Also I've never filled in a search page like this. Does anyone have a script that might do something similar I can take apart and use as an example? I need it semi-quick but I can't justify spending more than a day on it. Robert -- :wq! --------------------------------------------------------------------------- Robert L. Harris DISCLAIMER: These are MY OPINIONS With Dreams To Be A King, ALONE. I speak for First One Should Be A Man no-one else. - Manowar -------------- next part -------------- An HTML attachment was scrubbed... URL: From jay at jays.net Fri Mar 21 10:15:22 2014 From: jay at jays.net (Jay Hannah) Date: Fri, 21 Mar 2014 12:15:22 -0500 Subject: [Denver-pm] Sample HTTP interaction script. In-Reply-To: References: Message-ID: On Mar 21, 2014, at 12:11 PM, Robert L. Harris wrote: > I need to throw something simple together real quick. A one-timer that SHOULDN"T be re-used... > > I need to connect to a site, http://foo.bar:/8052/Login.html > > I am then prompted for a login/password. Once I log in I am given a new page : http://foo.bar:8052/App.html > > On this page is a search box, amongst other things, I want to put in a value (user filled variable) and post the search. Then scrape the resulting page for a result. > > > I have done basic auth using apache auth but this is the app requiring a login using a backend database. Also I've never filled in a search page like this. > > Does anyone have a script that might do something similar I can take apart and use as an example? I need it semi-quick but I can't justify spending more than a day on it. Should be easy with WWW::Mechanize: https://metacpan.org/pod/WWW::Mechanize#SYNOPSIS HTH, j (P.S. Why is the Denver mailing list set to reply to author? Isn't reply to list better?) From robert.l.harris at gmail.com Fri Mar 21 13:02:25 2014 From: robert.l.harris at gmail.com (Robert L. Harris) Date: Fri, 21 Mar 2014 14:02:25 -0600 Subject: [Denver-pm] Sample HTTP interaction script. In-Reply-To: References: Message-ID: So close. Seems the form is being done in Javascript which Mech doesn't work with. Looking into WWW::Scripter next it seems. On Fri, Mar 21, 2014 at 11:15 AM, Jay Hannah wrote: > On Mar 21, 2014, at 12:11 PM, Robert L. Harris > wrote: > > I need to throw something simple together real quick. A one-timer that > SHOULDN"T be re-used... > > > > I need to connect to a site, http://foo.bar:/8052/Login.html > > > > I am then prompted for a login/password. Once I log in I am given a new > page : http://foo.bar:8052/App.html > > > > On this page is a search box, amongst other things, I want to put in a > value (user filled variable) and post the search. Then scrape the > resulting page for a result. > > > > > > I have done basic auth using apache auth but this is the app requiring a > login using a backend database. Also I've never filled in a search page > like this. > > > > Does anyone have a script that might do something similar I can take > apart and use as an example? I need it semi-quick but I can't justify > spending more than a day on it. > > Should be easy with WWW::Mechanize: > > https://metacpan.org/pod/WWW::Mechanize#SYNOPSIS > > HTH, > > j > > > > > (P.S. Why is the Denver mailing list set to reply to author? Isn't reply > to list better?) > > > > > _______________________________________________ > Denver-pm mailing list > Denver-pm at pm.org > http://mail.pm.org/mailman/listinfo/denver-pm > -- :wq! --------------------------------------------------------------------------- Robert L. Harris DISCLAIMER: These are MY OPINIONS With Dreams To Be A King, ALONE. I speak for First One Should Be A Man no-one else. - Manowar -------------- next part -------------- An HTML attachment was scrubbed... URL: From jay at jays.net Fri Mar 21 19:28:26 2014 From: jay at jays.net (Jay Hannah) Date: Fri, 21 Mar 2014 21:28:26 -0500 Subject: [Denver-pm] Sample HTTP interaction script. In-Reply-To: References: Message-ID: <954905D5-98DD-4D57-87E7-ABF43CDBAF54@jays.net> On Mar 21, 2014, at 3:02 PM, Robert L. Harris wrote: > So close. Seems the form is being done in Javascript which Mech doesn't work with. Looking into WWW::Scripter next it seems. Oh? Let us know how it goes! :) j