livedoorクリップをソースにして、はてブと delicious に同期取る YAML 晒し。(>otsuneさん)
config.sbmsync.yaml
include:
- /home/zeromemory/plagger/config/config.base.yaml
- /home/zeromemory/plagger/config/recipes.sbm.yaml
plugins:
- module: Subscription::Config
config:
feed:
- url: http://clip.livedoor.com/rss/clips/suvene
- module: Filter::TruePermalink
follow_redirect: 0
- module: Filter::Rule
disable: 0
rule:
module: Deduped
path: /home/zeromemory/plagger/cache/sbmsync.tmp
compare_body: 1
recipes:
- hatena
- delicious
config.base.yaml は、global きってるだけなので省略。
recipes.sbm.yaml
define_recipes:
hatena:
- module: Publish::HatenaBookmark
config:
username: xxxxx
password: xxxxx
interval: 2
post_body: 1
delicious:
- module: Publish::Delicious
config:
username: xxxxx
password: xxxxx
interval: 2
post_body: 1
んで、クリップの link が URL に # が含まれると %23 にデコードされてるので、やっつけ的に
assets/plugins/Filter-TruePermalink/livedoor_clip.yaml
rewrite: |
if ($args->{feed}->url =~ m!http://clip\.livedoor\.com/rss/clips!) {
if (s|%23|#|g) {
$args->{entry}->link($_);
return 1;
}
}
こんな感じでス。
[plagger]
* 関連記事
suVeneのあれ: [Plagger]フィード内の pemalink, body 以外を書き換える時のスマートな方法は?