be stricter on type
This commit is contained in:
parent
908288f566
commit
666a480c3f
1 changed files with 3 additions and 2 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue