範囲を限定してリンクを抜き出すというのは、#plagger-ja で教えていただいて Subscription::Config や Subscription::XPath で解決しました。
が……
それを動かすまでに、assets_path でおおはまり。
「ブロックプラグインごとに指定した assets_path では、モジュール名は補われない」
CustomFeed::Config の extract に指定する正規表現で先読み (?=...) を使っているとうまく動かなかったので 対応しました。とりあえずちゃんと動いているようには見えます。
--- Config.pm 2006-09-13 01:44:55.518269472 +0900
+++ local/plagger/lib/Plagger/Plugin/CustomFeed/Config.pm 2006-09-13 01:44:29.439234088 +0900
@@ -95,18 +95,23 @@
Plagger->context->error($@) if $@;
}
+ my $prev_pos = 0;
+ my $cur_pos = 0;
while (1) {
my $data;
my $extract = decode_content($plugin->{extract});
if ($content =~ /$extract/sg) {
- if (my @match = $& =~ /$plugin->{extract}/s) {
+ $cur_pos = pos $content;
+ my $str = substr($content, $prev_pos, length($content));
+ if (my @match = $str =~ /$plugin->{extract}/s) {
my @capture = split /\s+/, $plugin->{extract_capture};
for my $m (@match) {
my $val = shift @capture;
$data->{$val} = $data->{$val} . $m;
}
}
+ $prev_pos = $cur_pos;
}
if ($plugin->{extract_xpath}) {
http://moteruzyutu.seesaa.net/article/24003734.html<br>失恋が人生を変えた!恋愛・合コン・ナンパが上手くなり、モテる男になるブログ<br>童貞だったらどう行動するか?と 今日のニュースに一言ボソリ♪<br>童貞だったらどう行動するか?と 今日のニュースに一言ボソリ♪