(※最新版はこちら↓です。以下は旧記事になります。)
今回は少し複雑です。
- 画像があるサイト
- その画像が相対パスで記述されている
という場合。
ニュースサイトなら本文を取得すれば済む話ですが、画像が相対パスで貼られているとそのままでは表示されません。で、
この記事でmiyagawaさんが解説されてるように、画像を一旦ローカルに保存してから添付する…という方法をとるみたいです。
config.yamakam.yaml
plugins: - module: Subscription::Config config: feed: - http://www1.odn.ne.jp/cjt24200/yamada/ - module: CustomFeed::Config - module: Filter::FindEnclosures - module: Filter::FetchEnclosure config: dir: ./tmp fake_referer: 1 - module: Publish::Gmail config: attach_enclosures: 1 mailto: hoge@gmail.com mailfrom: hoge+plagger@gmail.com mailroute: via: smtp_tls host: smtp.gmail.com:587 username: hoge@gmail.com password: xxx
これの
- module: Filter::FindEnclosures - module: Filter::FetchEnclosure config: dir: ./tmp fake_referer: 1
と、
- module: Publish::Gmail config: attach_enclosures: 1
この辺が肝らしい。
追記
…という方法は回りくどいし時間がかかりますが、otsuneさんにご指摘頂いて、
- module: Filter::ResolveRelativeLink
という1行を追加すれば済むみたいです。_| ̄|○
config.yamakam.yaml
plugins: - module: Subscription::Config config: feed: - http://www1.odn.ne.jp/cjt24200/yamada/ - module: CustomFeed::Config - module: Filter::ResolveRelativeLink