Skip to content

Instantly share code, notes, and snippets.

@hmsk
Last active August 29, 2015 14:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hmsk/b7482dc0a3a5a8b22c42 to your computer and use it in GitHub Desktop.
Save hmsk/b7482dc0a3a5a8b22c42 to your computer and use it in GitHub Desktop.
require 'open-uri'
require 'json'
body = open('http://www3.nhk.or.jp/news/easy/news-list.json', "r:utf-8").read.gsub("\xEF\xBB\xBF", '')
begin
json = JSON.parse(body)
p json
rescue JSON::ParserError => e
puts e.message
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment