Skip to content

Commit

Permalink
Fixes to return zero when first time error
Browse files Browse the repository at this point in the history
  • Loading branch information
tosik committed Apr 5, 2013
1 parent 5732e58 commit d9fd2b9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/ikioi/checker.rb
Expand Up @@ -14,7 +14,9 @@ def initialize(keyword, board_name)
def fetch def fetch
@last_ikioi = parse(fetch_jsonp).find {|item| item['title'].include?(keyword) }['ikioi'] @last_ikioi = parse(fetch_jsonp).find {|item| item['title'].include?(keyword) }['ikioi']
rescue OpenURI::HTTPError => e rescue OpenURI::HTTPError => e
@last_ikioi @last_ikioi || 0
rescue
0
end end


def parse(jsonp) def parse(jsonp)
Expand Down

0 comments on commit d9fd2b9

Please sign in to comment.