<%args> $trkId $brief => undef <%init> use LWP::UserAgent; my $model = $m->notes('MODEL'); # Get MPC-formatted tracklet. my $cmd = "mt --global_oid=$trkId --instance=$model --mpc --xd $trkId"; my @data = `$cmd`; my $data = join("\r\n", @data) . "\r\n"; # Get digest over HTTP from MPC. my $url = 'http://scully.harvard.edu/cgi-bin/possneo.cgi'; my $ua = LWP::UserAgent->new(timeout => 600); $ua->agent("Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.1) Gecko/20061208 Firefox/2.0.0.1"); my $response = $ua->post( $url, { TextArea => $data }, ); my $html = $response->content; # Run MOPS digest2. my @mops_digest2 = grep /T|Desig/, `neodigest $model $trkId all`; # Emit. $r->content_type('text/plain'); $m->clear_buffer; if ($brief) { my @htmlines = split /[\r\n]+/, $html; $m->print(join("\r\n", 'MPC Digest2', @htmlines[0..2]), "\r\n\r\nMOPS Digest2\r\n", @mops_digest2, "\r\n"); } else { $m->print($html); $m->print("\r\n--- INPUT DATA ---\r\n\r\n"); $m->print($cmd, "\r\n", @data); } $m->abort;