Skip to content

Instantly share code, notes, and snippets.

@mwlang
Created May 1, 2019 18:30
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 mwlang/f51ddb0065411b33eebcff0c7d89d9a0 to your computer and use it in GitHub Desktop.
Save mwlang/f51ddb0065411b33eebcff0c7d89d9a0 to your computer and use it in GitHub Desktop.
{"interval":"1M","timestamp":1556308620,"high_price":22.8058,"low_price":22.7881,"open_price":22.8058,"close_price":22.7881,"target_volume":14706.032755,"base_volume":644.92}
{"interval":"1M","timestamp":1556308680,"high_price":22.7885,"low_price":22.7109,"open_price":22.7885,"close_price":22.744,"target_volume":41692.869956,"base_volume":1833.33}
{"interval":"1M","timestamp":1556308740,"high_price":22.7867,"low_price":22.7213,"open_price":22.7265,"close_price":22.763,"target_volume":57258.608166,"base_volume":2516.55}
{"interval":"1M","timestamp":1556308800,"high_price":22.7869,"low_price":22.7208,"open_price":22.7584,"close_price":22.7863,"target_volume":29642.196593,"base_volume":1302.67}
{"interval":"1M","timestamp":1556308860,"high_price":22.7983,"low_price":22.7861,"open_price":22.7978,"close_price":22.7861,"target_volume":2494.932451,"base_volume":109.44}
require "json"
lines = File.read("./sample.json").split("\n")
lines.pop
data = lines.map { |l| JSON.parse(l) }
puts data.inspect
require "json"
lines = File.read("./sample.json").split("\n")
data = lines.map { |l| JSON.parse(l) }
puts data.inspect
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment