summaryrefslogtreecommitdiff
path: root/lib/feed2imap/feed2imap.rb
diff options
context:
space:
mode:
authorlnu <lnu@f70e237a-67f3-0310-a06c-d2b8a7116972>2005-07-22 08:59:13 +0000
committerlnu <lnu@f70e237a-67f3-0310-a06c-d2b8a7116972>2005-07-22 08:59:13 +0000
commit146beb0d171a4158abd4e8f7f39c69013aeea99e (patch)
treeddf49e3946615ea5b392e817c27e9e6e05d82b8a /lib/feed2imap/feed2imap.rb
parent6941a59386d4d7d6de2c505dda54912e9a163f71 (diff)
downloadfeed2imap-146beb0d171a4158abd4e8f7f39c69013aeea99e.tar.gz
feed2imap-146beb0d171a4158abd4e8f7f39c69013aeea99e.tar.bz2
feed2imap-146beb0d171a4158abd4e8f7f39c69013aeea99e.zip
git-svn-id: svn+ssh://svn.gna.org/svn/feed2imap/trunk/feed2imap@39 f70e237a-67f3-0310-a06c-d2b8a7116972
Diffstat (limited to 'lib/feed2imap/feed2imap.rb')
-rw-r--r--lib/feed2imap/feed2imap.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/feed2imap/feed2imap.rb b/lib/feed2imap/feed2imap.rb
index 59997e8..1ae946c 100644
--- a/lib/feed2imap/feed2imap.rb
+++ b/lib/feed2imap/feed2imap.rb
@@ -87,9 +87,13 @@ class Feed2Imap
@config.feeds.each do |f|
ths << Thread::new do
begin
- f.body = HTTPFetcher::fetch(f.url, @cache.get_last_check(f.name))
+ lastcheck = @cache.get_last_check(f.name)
+ if f.needfetch(lastcheck)
+ f.body = HTTPFetcher::fetch(f.url, @cache.get_last_check(f.name))
+ @cache.set_last_check(f.name, Time::now)
+ end
# dump if requested
- if @config.dumpdir
+ if @config.dumpdir and f.body
fname = @config.dumpdir + '/' + f.name + '-' + Time::now.xmlschema
File::open(fname, 'w') { |file| file.puts f.body }
end