#!/usr/local/bin/perl -w # useperl2mt - Converts use Perl; journal to MT exported data use strict; use LWP::Simple; # Config variables our $Uid = 1653; # use Perl's UID our $Author = "miyagawa"; our $AllowComments = 1; our $AllowPings = 1; our $Category = "Perl"; # category for TypePad my $url = "http://use.perl.org/journal.pl?op=list&uid=$Uid"; my $html = get($url); my $pat = <<'PAT'; (.*?) \s*
\n\t*(.*?)\n\t*
\n!s or die "no match: $html";
my @d = $date =~ /^(\d{4})\.(\d{2})\.(\d{2}) +(\d{1,2}):(\d{2})$/ or die "no match: $date";
my($ampm, $hour) = ($d[3] > 12) ? ("PM", $d[3] - 12) : ("AM", $d[3]);
my $mt_date = "$d[1]/$d[2]/$d[0] $hour:$d[4]:00 $ampm";
return <