Permalink
Browse files

Fixed comic_num var

  • Loading branch information...
1 parent 0edb078 commit 616b714d6ec7ea695d409c931a3048699c992b10 @hemanth committed May 22, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/xkcd.rb
View
@@ -34,7 +34,7 @@ def self.img
max = JSON.parse(open('http://xkcd.com/info.0.json').read)["num"]
comic_num = Random.rand(max)
comic_num = 1 if comic_num == 404 # Avoid 404th comic ;)
- comic = JSON.parse(open("http://xkcd.com/#{random_comic}/info.0.json").read)
+ comic = JSON.parse(open("http://xkcd.com/#{comic_num}/info.0.json").read)
"#{comic['alt']} : #{comic['img']}"
end
end

0 comments on commit 616b714

Please sign in to comment.