plagger

インストール

ActivePerl 5.8.8.820のppmからインストールした。

  1. ppm rep add tcool http://ppm.tcool.org/archives/
  2. ppm search plagger
  3. ppm install plagger

C:\work\src\plagger>plagger -v
Plagger version 0.7.17

実行

plaggerの制御ルールをYAML形式で記述する。

C:\work\src\plagger>vim hello.yaml

ソースの内容

plugins:
- module: CustomFeed::Debug
config:
title: 'Example Blog'
link: 'http://www.example.com/'
entry:
- title: 'Hello'
link: 'http://www.example.com/hello.html'
body: 'Hello, world!'

- module: Publish::OutlineText
config:
filename: /tmp/hello.txt
encoding: Shift_JIS

実行すると・・・

C:\work\src\plagger>vim hello.yaml

C:\work\src\plagger>plagger -c hello.yaml
Died at C:/Perl/site/lib/YAML/Loader.pm line 657, <$IN> line 1.

原因は自動改行で挿入されるタブだった。タブが含まれているとエラーになるらしい。

もう一度、再実行すると・・・

C:\work\src\plagger>plagger -c hello.yaml
Plagger [info] plugin Plagger::Plugin::CustomFeed::Debug loaded.
Plagger [info] plugin Plagger::Plugin::Publish::OutlineText loaded.
Plagger [info] plugin Plagger::Plugin::Bundle::Defaults loaded.
Plagger [info] plugin Plagger::Plugin::Aggregator::Simple loaded.
Plagger [info] plugin Plagger::Plugin::Summary::Auto loaded.
Plagger [info] plugin Plagger::Plugin::Summary::Simple loaded.
Plagger [info] plugin Plagger::Plugin::Namespace::HatenaFotolife loaded.
Plagger [info] plugin Plagger::Plugin::Namespace::MediaRSS loaded.
Plagger [info] plugin Plagger::Plugin::Namespace::ApplePhotocast loaded.

実行結果のテキストファイルを参照すると

C:\work\src\plagger>type c:\tmp\hello.txt
.Example Blog
..Hello
Hello, world!

OK.出来ていた。