Skip to content

Instantly share code, notes, and snippets.

@markprovan
Created August 8, 2013 10:15
Show Gist options
  • Save markprovan/6183460 to your computer and use it in GitHub Desktop.
Save markprovan/6183460 to your computer and use it in GitHub Desktop.
Convert Google Chromes Network anaylsis to csv. Right click and copy HAR, then save that file as json. `ruby gc_network_to_csv.rb network.json`
require "json"
require "csv"
filename = ARGV[0]
json = JSON.parse(File.read(filename))
CSV.open("#{filename.gsub('.json', '')}.csv", "w") do |csv|
csv << ["URL", "File Size"]
json["log"]["entries"].each do |r|
csv << [r["request"]["url"], r["response"]["content"]["size"]]
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment