Skip to content

Commit

Permalink
Correct Net::HTTP example
Browse files Browse the repository at this point in the history
get() requires a Hash as the second variable if you pass one.
www.reddit.com now redirects on /index.html
  • Loading branch information
dabble committed Mar 25, 2012
1 parent 2b77ed3 commit 98ae87a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions refresher.md
Expand Up @@ -524,8 +524,8 @@ previously established rule.
end

require 'net/http'
h = Net::HTTP.new('www.reddit.com', 80)
resp, data = h.get('/index.html', nil)
h = Net::HTTP.new('www.amazon.com', 80)
resp, data = h.get('/index.html')
if resp.message == "OK"
data.scan(/<img src="(.*?)"/) { |x| puts x }
end
Expand Down

0 comments on commit 98ae87a

Please sign in to comment.