#!/usr/bin/perl -T -w use strict; use CGI qw/:standard/; print header, start_html('got times?'),"\n", h1("got times?"),"\n", hr,"\n", "1) start logserver, file - new workspace, start eve client, open contract.",br,"\n", "2) search logserver mess for contractMgr::GetContract lines with a green circle-arrow up front.",br,"\n", "3) paste ALL THREE LINES into this page.",br,"\n", "4) look at the dateCompleted timestamp, thats the time the contract was CREATED.",br,"\n", "5) ...",br,"\n", "6) profit!", start_form, textarea( -name => "text", -rows => 10, -columns => 50, ), submit, end_form, hr, "\n\n"; if (param()) { my $text = param("text"); $text =~ s/\s+/ /gs; $text =~ s/(^ | $)//g; $text =~ s/(^| )\d+ \d\d\d\d\.\d\d\.\d\d \d\d:\d\d:\d\d:\d+ (- )?//g; print h1("Got:"),"\n", escapeHTML($text), hr,"\n\n"; print STDERR $text; my %c = (); # while ($text =~ s/((?:<|<)Row )([^:]+):([^,]+),/$1/) { while ($text =~ s/(\W?)(\w+)\W?:([^,]+)(,|$)/$1$4/) { my ($k, $v,) = ($2, $3,); $v =~ s/\s+/ /g; $v =~ s/(^ | $)//g; if (defined $c{$k}) { printf "WARNING: redefining key '%s' from '%s' to '%s'%s\n", $k, $c{$k}, $v, br; } $c{$k} = $v; } for (sort keys %c) { print $_,": ", escapeHTML($c{$_}), br,"\n"; } print hr,"\n\n"; my $ct = "Contract:"; if ($c{startSolarSystemID} && $c{contractID}) { $ct .= " ".a({href =>"contract:".$c{startSolarSystemID}."//".$c{contractID},},$c{contractID}); } print h2($ct),"\n"; for (sort keys %c) { #next unless /^date/i && $c{$_} =~ /^(\d+)L$/; next unless $c{$_} =~ /^(\d{15,})L$/; use POSIX; my $s = gmtime(($1/10000000)-11644473600); print $_,": ",$c{$_}," == ",$s,br,"\n"; } print hr,"\n\n"; } print end_html;