Created
June 20, 2015 03:48
-
-
Save dd1994/ca3d3165601a854f130a to your computer and use it in GitHub Desktop.
ruby http get example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "net/http" | |
require "json" | |
news_string = Net::HTTP.get(URI('http://node-hnapi.herokuapp.com/news')) | |
news = JSON.parse(news_string) | |
puts news |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment