Changeset 33 in bookmarks


Ignore:
Timestamp:
05/24/13 01:26:04 (12 years ago)
Author:
peter
Message:
  • generate Atom 1.0 feeds
  • include an <updated> element in each entry in the feed, using the bookmark mtime
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BookmarkApp.pm

    r32 r33  
    210210    my $title = 'Bookmarks' . (@tags ? " tagged as " . join(' & ', @tags) : ''); 
    211211 
     212    require XML::Atom; 
     213    $XML::Atom::DefaultVersion = "1.0"; 
     214 
    212215    require XML::Atom::Feed; 
    213216    require XML::Atom::Entry; 
     
    244247        $entry->add_link($link); 
    245248        $entry->summary('Tags: ' . join(', ', @{ $bookmark->tags })); 
     249        my $mdatetime = time2isoz $bookmark->mtime; 
     250        # make the timestamp W3C-correct 
     251        $mdatetime =~ s/ /T/; 
     252        $entry->updated($mdatetime); 
    246253        $feed->add_entry($entry); 
    247254    } 
Note: See TracChangeset for help on using the changeset viewer.