Changeset 940

Show
Ignore:
Timestamp:
06/09/06 16:11:35
Author:
miyagawa
Message:

use Last-Modified header to populate entry date, even if handler can't find one.
via http://subtech.g.hatena.ne.jp/otsune/20060608/norkdailymemo

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/plagger/lib/Plagger/Plugin/Filter/EntryFullText.pm

    r923 r940  
    122122            $args->{entry}->permalink($base); 
    123123        } 
     124    } 
     125 
     126    # use Last-Modified to populate entry date, even if handler doesn't find one 
     127    if ($res->last_modified && !$args->{entry}->date) { 
     128        $args->{entry}->date( Plagger::Date->from_epoch($res->last_modified) ); 
    124129    } 
    125130 
     
    139144                $args->{entry}->icon({ url => $data->{icon} }) if $data->{icon}; 
    140145 
    141                 # extract date using found one, falls back to Last-Modified 
     146                # extract date using found one 
    142147                if ($data->{date}) { 
    143148                    $args->{entry}->date($data->{date}); 
    144                 } elsif ($res->last_modified) { 
    145                     $args->{entry}->date( Plagger::Date->from_epoch($res->last_modified) ); 
    146149                } 
    147150