Changeset 357

Show
Ignore:
Timestamp:
03/07/06 11:14:16
Author:
miyagawa
Message:

add a nasty hack to support Atom 1.0 published (was called issued in 0.3)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/plagger/lib/Plagger/Plugin/Aggregator/Simple.pm

    r354 r357  
    6060    $feed->url($url); 
    6161    $feed->link($remote->link); 
    62     $feed->description($remote->tagline); 
     62    $feed->description($remote->tagline); # xxx should support Atom 1.0 
    6363    $feed->language($remote->language); 
    6464    $feed->author($remote->author); 
     
    8989        $entry->date( Plagger::Date->rebless($e->issued) ) 
    9090            if eval { $e->issued }; 
     91 
     92        # xxx nasty hack. We should remove this once XML::Atom or XML::Feed is fixed 
     93        if (!$entry->date && $remote->format eq 'Atom' && $e->{entry}->version eq '1.0') { 
     94            my $published = $e->{entry}->published; 
     95            if ($published) { 
     96                my $dt = XML::Atom::Util::iso2dt($published); 
     97                $entry->date( Plagger::Date->rebless($dt) ); 
     98            } 
     99        } 
     100 
    91101        $entry->link($e->link); 
    92102        $entry->id($e->id);