be stricter on type

This commit is contained in:
Ward Wouts 2020-10-18 16:08:17 +02:00
parent 908288f566
commit 666a480c3f

View file

@ -331,7 +331,8 @@ def get_articles(cachedir=false)
art[id] = {} unless art.has_key?(id) art[id] = {} unless art.has_key?(id)
begin begin
lastdate = art[id]["date"] = DateTime.parse(date).strftime('%Y%m%d') lastdate = DateTime.parse(date)
art[id]["date"] = DateTime.parse(date).strftime('%Y%m%d')
rescue rescue
puts $!.message puts $!.message
puts id puts id
@ -361,7 +362,7 @@ def get_articles(cachedir=false)
end end
} }
if @maxage and @maxage > 0 if @maxage and @maxage > 0
if DateTime.parse(lastdate) < ( DateTime.now - @maxage ) if lastdate < ( DateTime.now - @maxage )
puts "Skipping articles older than #{DateTime.now - @maxage}" puts "Skipping articles older than #{DateTime.now - @maxage}"
break break
end end