Changeset 32 in bookmarks


Ignore:
Timestamp:
05/24/13 01:04:09 (12 years ago)
Author:
peter
Message:
  • include any tag query parameters in the Atom feed id, self link, and HTML link
  • include a @rel="self" link to the feed itself
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BookmarkApp.pm

    r31 r32  
    216216    my $feed = XML::Atom::Feed->new; 
    217217    $feed->title($title); 
    218     $feed->id($base_uri->canonical . 'feed'); 
     218 
     219    my $feed_uri = URI->new_abs('feed', $base_uri); 
     220    $feed_uri->query_form(tag => \@tags); 
     221    $feed->id($feed_uri->canonical); 
     222 
     223    my $self_link = XML::Atom::Link->new; 
     224    $self_link->type('application/atom+xml'); 
     225    $self_link->rel('self'); 
     226    $self_link->href($feed_uri->canonical); 
     227    $feed->add_link($self_link); 
     228 
    219229    my $html_link = XML::Atom::Link->new; 
    220230    $html_link->type('text/html'); 
    221231    $html_link->rel('alternate'); 
    222     $html_link->href($base_uri->canonical); 
     232    my $html_uri = $base_uri->clone; 
     233    $html_uri->query_form(tag => \@tags); 
     234    $html_link->href($html_uri->canonical); 
    223235    $feed->add_link($html_link); 
    224236 
Note: See TracChangeset for help on using the changeset viewer.