Trouble extracting individual JSON values in Ruby
问题 I'm in the process of trying to scrape reddit (API-free) and I've run into a brick wall. On reddit, every page has a JSON representation that can be seen simply by appending .json to the end, e.g. https://www.reddit.com/r/AskReddit.json . I installed NeatJS, and wrote a small chunk of code to clean the JSON up and print it: require "rubygems" require "json" require "net/http" require "uri" require 'open-uri' require 'neatjson' url = ("https://www.reddit.com/r/AskReddit.json") result = JSON