otsune さんからコメントをいただきました。 (ツッコミは URI を 5 つまで許すようにしてみました。 どうもご迷惑をおかけしました。Trackback は……何でだろう?)
http://subtech.g.hatena.ne.jp/otsune/20060911/followlink
確かに Subscription::XPath がそれっぽそうなので試してみたところ……
% w3m -dump_source http://shakenbu.org/yanagi/d/s/20060911/index.html
<html>
<head>
<title>index</title>
</head>
<body>
<div id="hoge">
[<a href="1.html">1</a>]
[<a href="2.html">2</a>]
</div>
</body>
</html>
% cat test2.yaml
plugins:
- module: Subscription::XPath
config:
url: http://shakenbu.org/yanagi/d/s/20060911/index.html
xpath: //div[@id='hoge']//a
- module: CustomFeed::Simple
- module: Publish::Debug
% plagger -c test2.yaml
Plagger [info] plugin Plagger::Plugin::Subscription::XPath loaded.
Plagger [info] plugin Plagger::Plugin::CustomFeed::Simple loaded.
Plagger [info] plugin Plagger::Plugin::Publish::Debug loaded.
Plagger::Util [debug] Fetch remote file from http://shakenbu.org/yanagi/d/s/20060911/index.html
Plagger::Cache [debug] Cache HIT: Subscription-XPath|http://shakenbu.org/yanagi/d/s/20060911/index.html
Plagger [info] plugin Plagger::Plugin::Aggregator::Simple loaded.
Plagger::Plugin::Aggregator::Simple [info] Fetch http://shakenbu.org/yanagi/d/s/20060911/1.html
Plagger::Cache [debug] Cache HIT: Aggregator-Simple|http://shakenbu.org/yanagi/d/s/20060911/1.html
Plagger::Plugin::Aggregator::Simple [debug] 304: http://shakenbu.org/yanagi/d/s/20060911/1.html
Plagger [error] http://shakenbu.org/yanagi/d/s/20060911/1.html is not aggregated by any aggregator
Plagger::Plugin::Aggregator::Simple [info] Fetch http://shakenbu.org/yanagi/d/s/20060911/2.html
Plagger::Cache [debug] Cache HIT: Aggregator-Simple|http://shakenbu.org/yanagi/d/s/20060911/2.html
Plagger::Plugin::Aggregator::Simple [debug] 304: http://shakenbu.org/yanagi/d/s/20060911/2.html
Plagger [error] http://shakenbu.org/yanagi/d/s/20060911/2.html is not aggregated by any aggregator
とエラーになってしまいました。
Subscription::Config で follow_link を書かなかったときと同じエラーだなぁ。
Plagger の YAML ファイルのサンプルを見てまわると、この follow_link は書かれていたり書かれていなかったりして、 どんな場合に必要なのかよくわからない。
% cat test.yaml
plugins:
- module: Subscription::Config
config:
feed:
- url: http://shakenbu.org/yanagi/d/s/20060911/index.html
# meta:
# follow_link: .*
- module: CustomFeed::Simple
- module: Publish::Debug
% plagger -c test.yaml
Plagger [info] plugin Plagger::Plugin::Subscription::Config loaded.
Plagger [info] plugin Plagger::Plugin::CustomFeed::Simple loaded.
Plagger [info] plugin Plagger::Plugin::Publish::Debug loaded.
Plagger [info] plugin Plagger::Plugin::Aggregator::Simple loaded.
Plagger::Plugin::Aggregator::Simple [info] Fetch http://shakenbu.org/yanagi/d/s/20060911/index.html
Plagger::Cache [debug] Cache MISS: Aggregator-Simple|http://shakenbu.org/yanagi/d/s/20060911/index.html
Plagger::Plugin::Aggregator::Simple [debug] 200: http://shakenbu.org/yanagi/d/s/20060911/index.html
Plagger [error] http://shakenbu.org/yanagi/d/s/20060911/index.html is not aggregated by any aggregator
ソースを追いかけてもみたけれど、Perl は文法からしてよく知らないので頓挫。
follow_linkしないのはPerlとは無関係で単にXPathが拾えていないのかもしれないので<br>xpath: //div['hoge']/a<br>みたいにすればokかも?