Changeset 788

Show
Ignore:
Timestamp:
05/19/06 19:26:24
Author:
miyagawa
Message:
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/plagger/assets/plugins/Filter-EntryFullText/nikkansports.yaml

    r559 r788  
    99  - %Y年%m月%d日%H時%M分 
    1010  - %Y/%m/%d %H:%M 
    11  
     11extract_date_timezone: Asia/Tokyo 
  • trunk/plagger/lib/Plagger/Plugin/CustomFeed/Simple.pm

    r737 r788  
    5050    my $re = $args->{match}; 
    5151 
     52    my %seen; 
    5253    my $parser = HTML::TokeParser->new(\$content); 
    5354    while (my $token = $parser->get_tag('a')) { 
     
    5556 
    5657        my $text = $parser->get_trimmed_text('/a'); 
     58        next if !$text || $text eq '[IMG]'; 
     59 
     60        my $url = URI->new_abs($token->[1]->{href}, $url); 
     61        next if $seen{$url->as_string}++; 
     62 
    5763        my $entry = Plagger::Entry->new; 
    5864        $entry->title($text); 
    59         $entry->link( URI->new_abs($token->[1]->{href}, $url) ); 
     65        $entry->link($url); 
    6066        $feed->add_entry($entry); 
    6167 
    62         $context->log(debug => "Add $token->[1]->{href}"); 
     68        $context->log(debug => "Add $token->[1]->{href} ($text)"); 
    6369    } 
    6470 
  • trunk/plagger/lib/Plagger/Plugin/Filter/EntryFullText.pm

    r689 r788  
    178178    # decode as UTF-8 
    179179    for my $key ( qw(extract extract_date_format) ) { 
     180        next unless defined $data->{$key}; 
    180181        if (ref $data->{$key} && ref $data->{$key} eq 'ARRAY') { 
    181182            $data->{$key} = [ map decode("UTF-8", $_), @{$data->{$key}} ]; 
     
    227228                $format = [ $format ] unless ref $format; 
    228229                $data->{date} = (map { Plagger::Date->strptime($_, $data->{date}) } @$format)[0]; 
     230                if ($data->{date} && $self->{extract_date_timezone}) { 
     231                    $data->{date}->set_time_zone($self->{extract_date_timezone}); 
     232                } 
    229233            } else { 
    230234                $data->{date} = Plagger::Date->parse_dwim($data->{date});