summaryrefslogtreecommitdiff
path: root/lib/feed2imap/feed2imap.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/feed2imap/feed2imap.rb')
-rw-r--r--lib/feed2imap/feed2imap.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/feed2imap/feed2imap.rb b/lib/feed2imap/feed2imap.rb
index a9a2c59..92cab8f 100644
--- a/lib/feed2imap/feed2imap.rb
+++ b/lib/feed2imap/feed2imap.rb
@@ -81,6 +81,11 @@ class Feed2Imap
end
begin
body = HTTPFetcher::fetch(f.url, @cache.get_last_check(f.name))
+ # dump if requested
+ if @config.dumpdir
+ fname = @config.dumpdir + '/' + f.name + '-' + Time::now.xmlschema
+ File::open(fname, 'w') { |file| file.puts body }
+ end
rescue Timeout::Error
@logger.fatal("Timeout::Error while fetching #{f.url}: #{$!}")
next