Changeset 866

Show
Ignore:
Timestamp:
05/30/06 17:32:50
Author:
miyagawa
Message:

more Photos! support Apple's evil photocast namespace.

Files:

Legend:

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

    r865 r866  
    184184 
    185185        # Hatena Image extensions 
    186         my $hatena = $e->{entry}->{"http://www.hatena.ne.jp/info/xmlns#"}
     186        my $hatena = $e->{entry}->{"http://www.hatena.ne.jp/info/xmlns#"} || {}
    187187        if ($hatena->{imageurl}) { 
    188188            my $enclosure = Plagger::Enclosure->new; 
     
    194194        if ($hatena->{imageurlsmall}) { 
    195195            $entry->icon({ url   => $hatena->{imageurlsmall} }); 
     196        } 
     197 
     198        # Apple photocast feed 
     199        my $apple = $e->{entry}->{"http://www.apple.com/ilife/wallpapers"} || {}; 
     200        if ($apple->{image}) { 
     201            my $enclosure = Plagger::Enclosure->new; 
     202            $enclosure->url( URI->new($apple->{image}) ); 
     203            $enclosure->auto_set_type; 
     204            $entry->add_enclosure($enclosure); 
     205        } 
     206        if ($apple->{thumbnail}) { 
     207            $entry->icon({ url => $apple->{thumbnail} }); 
    196208        } 
    197209