root/trunk/plagger/t/plugins/CustomFeed-Simple/xpath.t

Revision 1683 (checked in by mizzy, 14 years ago)

CustomFeed?::Simple: support follow_xpath option to extract links by XPath.

  • Property svn:executable set to *
Line 
1 use strict;
2 use t::TestPlagger;
3
4 test_requires_network 'd.hatena.ne.jp:80';
5
6 plan 'no_plan';
7
8 run_eval_expected;
9
10 __END__
11
12 === Test Simple CustomFeed
13 --- input config
14 plugins:
15   - module: Subscription::Config
16     config:
17       feed:
18         - url: http://d.hatena.ne.jp/antipop/20050628/1119966355
19           meta:
20             follow_xpath: //ul[@class="xoxo" or @class="subscriptionlist"]//a
21        
22   - module: CustomFeed::Simple
23
24 --- expected
25 is $context->update->feeds->[0]->link, 'http://d.hatena.ne.jp/antipop/20050628/1119966355';
26 ok $context->update->feeds->[0]->count;
27 is $context->update->feeds->[0]->entries->[0]->title, 'blog.bulknews.net';
28 is $context->update->feeds->[0]->entries->[0]->link,  'http://blog.bulknews.net/mt/';
29 is $context->update->feeds->[0]->entries->[1]->title, 'bulknews.typepad.com';
30 is $context->update->feeds->[0]->entries->[1]->link,  'http://bulknews.typepad.com/';
Note: See TracBrowser for help on using the browser.