Changeset 556

Show
Ignore:
Timestamp:
04/07/06 13:47:32
Author:
miyagawa
Message:
  • Added news.com.com upgrader
  • Added parse_dwim method on Plagger::Date
  • FilterEntryFullText? uses DWIM parser when there's no date_format supplied in pattern files.
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/plagger/Makefile.PL

    r553 r556  
    2222requires('Module::Pluggable::Fast'); 
    2323requires('HTML::ResolveLink'); 
     24requires('Date::Parse'); 
    2425 
    2526build_requires(Test::More => 0.42); 
  • trunk/plagger/lib/Plagger/Date.pm

    r481 r556  
    2626 
    2727    bless $dt, $class; 
     28} 
     29 
     30sub parse_dwim { 
     31    my($class, $str) = @_; 
     32 
     33    require Date::Parse; 
     34    my $time = Date::Parse::str2time($str) or return; 
     35 
     36    $class->from_epoch($time); 
    2837} 
    2938 
  • trunk/plagger/lib/Plagger/Plugin/Filter/EntryFullText.pm

    r555 r556  
    216216        @{$data}{@capture} = @match; 
    217217 
    218         if ($data->{date} && $self->{extract_date_format}) { 
    219             $data->{date} = Plagger::Date->strptime($self->{extract_date_format}, $data->{date}); 
     218        if ($data->{date}) { 
     219            if ($self->{extract_date_format}) { 
     220                $data->{date} = Plagger::Date->strptime($self->{extract_date_format}, $data->{date}); 
     221            } else { 
     222                $data->{date} = Plagger::Date->parse_dwim($data->{date}); 
     223            } 
    220224        } 
    221225