diff --git a/news/article.rb b/news/article.rb index cbfe52a..5df84ef 100644 --- a/news/article.rb +++ b/news/article.rb @@ -331,7 +331,8 @@ def get_articles(cachedir=false) art[id] = {} unless art.has_key?(id) 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 puts $!.message puts id @@ -361,7 +362,7 @@ def get_articles(cachedir=false) end } 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}" break end