genorg.pl
changeset 23 b339b5ef7c97
parent 22 dc1add4ee525
equal deleted inserted replaced
22:dc1add4ee525 23:b339b5ef7c97
   633 
   633 
   634   # Date
   634   # Date
   635   for ($dom->findnodes('/html/body/div[@id="postamble"]/p[@class="date"]')) {
   635   for ($dom->findnodes('/html/body/div[@id="postamble"]/p[@class="date"]')) {
   636     my $text = $_->to_literal;
   636     my $text = $_->to_literal;
   637     if ($text =~ /^Date: (\d+)-(\d+)-(\d+)/) {
   637     if ($text =~ /^Date: (\d+)-(\d+)-(\d+)/) {
   638       my $date = PDate->new($1, $2, $3);
   638       # Well, at least you will learn something new
       
   639       my $date = PDate->new(@{^CAPTURE});
   639       $data{date} = $date;
   640       $data{date} = $date;
   640       my $p = $_->parentNode;
   641       my $p = $_->parentNode;
   641       $p->parentNode->removeChild($p);
   642       $p->parentNode->removeChild($p);
   642     }
   643     }
   643   }
   644   }
   706     my $self = shift;
   707     my $self = shift;
   707     my @months =
   708     my @months =
   708       qw(January Febuary March April May June July August September November October December);
   709       qw(January Febuary March April May June July August September November October December);
   709     my $n = $self->{day};
   710     my $n = $self->{day};
   710     if ($n == 1) { $n = '1st' }
   711     if ($n == 1) { $n = '1st' }
   711     elsif (($n - 2) % 10 == 0) { $n = "${n}nd" }
   712     elsif ($n == 22 || $n == 2) { $n = "${n}nd" }
   712     elsif (($n - 3) % 10 == 0) { $n = "${n}rd" }
   713     elsif ($n == 23 || $n == 3) { $n = "${n}rd" }
   713     else { $n = "${n}th" }
   714     else { $n = "${n}th" }
   714     $months[$self->{month} - 1] . " $n, " . $self->{year}
   715     $months[$self->{month} - 1] . " $n, " . $self->{year}
   715   }
   716   }
   716     
   717     
   717   sub short_fmt {
   718   sub short_fmt {