Changeset 1639
- Timestamp:
- 09/02/06 02:09:00
- Files:
-
- trunk/plagger (modified) (previous)
- trunk/plagger/lib/Plagger/Plugin/Subscription/XPath.pm (modified) (2 diffs)
- trunk/plagger/t/plugins/Subscription-XPath/subscription.t (modified) (2 diffs)
- trunk/plagger/t/samples/xoxo-relative.html (added)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/plagger/lib/Plagger/Plugin/Subscription/XPath.pm
r756 r1639 26 26 $tree->eof; 27 27 28 $self->find_feed($tree );28 $self->find_feed($tree, $uri); 29 29 } 30 30 31 31 sub find_feed { 32 my($self, $tree ) = @_;32 my($self, $tree, $uri) = @_; 33 33 for my $child ($tree->findnodes($self->conf->{xpath} || '//a')) { 34 34 my $href = $child->attr('href') or next; … … 36 36 37 37 my $feed = Plagger::Feed->new; 38 $feed->url( $href);38 $feed->url( URI->new_abs($href, $uri) ); 39 39 $feed->title($title); 40 40 trunk/plagger/t/plugins/Subscription-XPath/subscription.t
r1413 r1639 3 3 4 4 test_plugin_deps; 5 plan tests => 1;5 plan tests => 2; 6 6 run_eval_expected; 7 7 … … 24 24 'http://subtech.g.hatena.ne.jp/miyagawa/'] 25 25 ); 26 27 === test with relative link path 28 --- input config 29 plugins: 30 - module: Subscription::XPath 31 config: 32 url: file://$t::TestPlagger::BaseDirURI/t/samples/xoxo-relative.html 33 xpath: //a 34 - module: Aggregator::Null 35 --- expected 36 is $context->subscription->feeds->[0]->url, "file://$t::TestPlagger::BaseDirURI/t/samples/foo.html";
