5 ms·
How do you get the script to save the json file?
by richardpetersen 12y ago
How do you get the script to save the json file?
- hecticjeff 12y agoYou can redirect the output of the script to a json file, so in this case something like: $ ruby scraper.rb > showings.json
- richardpetersen 12y agoPerfect, thank you
- cheald 12y agoOr, you can write it from within Ruby: open("out.json", "w") {|f| f.puts JSON.dump(showings) }