Class | Yapra::Plugin::Publish::FileDownload |
In: |
lib-plugins/yapra/plugin/publish/file_download.rb
|
Parent: | Yapra::Plugin::Publish::OnMemoryDownload |
download file with WWW::Mechanize.
example:
- module: Publish::FileDownload config: regexp: http://www\.yahoo\.co\.jp/* dir: '/Users/yuanying/Downloads/' auto_suffix: true before_hook: "agent.get('http://www.yahoo.co.jp/'); sleep 1" url: attribute: link replace: index(\d*?)\.html to: file\1.zip filename: attribute: title replace: 'Yahoo' to: '' referrer: attribute: link replace: 'zip' to: 'html'