From d9fd2b96a350ffd70b31a8a4499d082893b3d6a7 Mon Sep 17 00:00:00 2001 From: Toshiyuki Hirooka Date: Fri, 5 Apr 2013 11:02:47 +0900 Subject: [PATCH] Fixes to return zero when first time error --- lib/ikioi/checker.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/ikioi/checker.rb b/lib/ikioi/checker.rb index 8d6f16e..cb0b576 100644 --- a/lib/ikioi/checker.rb +++ b/lib/ikioi/checker.rb @@ -14,7 +14,9 @@ def initialize(keyword, board_name) def fetch @last_ikioi = parse(fetch_jsonp).find {|item| item['title'].include?(keyword) }['ikioi'] rescue OpenURI::HTTPError => e - @last_ikioi + @last_ikioi || 0 + rescue + 0 end def parse(jsonp)