Changeset 1897

Show
Ignore:
Timestamp:
12/02/06 06:17:42
Author:
miyagawa
Message:

Added 'taguri_base' config to Publish::Feed, not to use plagger.org as a default.
updated Bundle::Planet to pass the hostname to taguri_base.
Fixes #455

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/plagger/lib/Plagger/Plugin/Bundle/Planet.pm

    r1876 r1897  
    8989            filename => 'atom.xml', 
    9090            format => 'Atom', 
     91            taguri_base => URI->new($self->conf->{url})->host, 
    9192        }, 
    9293    }); 
  • trunk/plagger/lib/Plagger/Plugin/Publish/Feed.pm

    r1865 r1897  
    5252        if $f->primary_author; 
    5353 
     54    my $taguri_base = $self->conf->{taguri_base} || do { 
     55        require Sys::Hostname; 
     56        Sys::Hostname::hostname(); 
     57    }; 
     58 
    5459    if ($feed_format eq 'Atom') { 
    55         $feed->{atom}->id("tag:plagger.org,2006:" . $f->id); # XXX what if id is empty? 
     60        $feed->{atom}->id("tag:$taguri_base,2006:" . $f->id); # XXX what if id is empty? 
    5661    } 
    5762 
     
    8691        } 
    8792 
    88         $entry->id("tag:plagger.org,2006:" . $e->id); 
     93        $entry->id("tag:$taguri_base,2006:" . $e->id); 
    8994 
    9095        if ($e->has_enclosure) { 
     
    210215Whether to publish full content feed. Defaults to 1. 
    211216 
     217=item taguri_base 
     218 
     219Domain name to use with Tag URI base for Atom feed IDs. If it's not 
     220set, the domain is grabbed using Sys::Hostname module. Optional. 
     221 
    212222=back 
    213223 
    214224=head1 AUTHOR 
    215225 
     226Tatsuhiko Miyagawa 
     227 
     228=head1 CONTRIBUTORS 
     229 
    216230Yoshiki Kurihara 
    217231 
    218 Tatsuhiko Miyagawa 
    219  
    220232Gosuke Miyashita 
    221233 
  • trunk/plagger/t/99-pod-spell.t

    r1852 r1897  
    6868HatenaGroup 
    6969HatenaRSS 
     70IDs 
    7071IE 
    7172IKC 
  • trunk/plagger/t/plugins/Bundle-Planet/bundle.t

    r1483 r1897  
    4545file_contains("$main::dir/index.html", qr(href="http://planet.plagger.org/foafroll.xml")); 
    4646file_contains("$main::dir/atom.xml", qr!href="http://planet.plagger.org/"!); 
     47file_contains("$main::dir/atom.xml", qr!tag:planet.plagger.org!); 
    4748file_contains("$main::dir/rss.xml", qr!<link>http://planet.plagger.org/</link>!); 
    4849file_contains("$main::dir/subscriptions.opml", qr!<head>\s*<title>Planet Foobar</title>!);