Last active
August 29, 2015 14:01
-
-
Save nerdinand/dcd0b3da194fe2ff2bcb to your computer and use it in GitHub Desktop.
Ruby one-liner for calculating the total activity of each of the tracks from an Auphonic production description file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "json"; p JSON.parse(File.read("ZCH042.json", external_encoding: "iso-8859-1", internal_encoding: "utf-8"))["statistics"]["tracks"].map{|t| [t["identifier"], t["activity"].nil? ? nil : t["activity"].map{|kv| kv[1] - kv[0]}.inject(:+)/60 ]} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment