Created
March 5, 2022 10:51
-
-
Save siman-man/b1e009050403390f65ec6b290843d14b to your computer and use it in GitHub Desktop.
parse mm ranking json 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' | |
require 'time' | |
user_name = 'simanman' | |
body = JSON.parse(File.read('ranking.json')) | |
submissions = body.select { |b| b['createdBy'] == user_name } | |
submissions.sort_by! { |sub| Time.parse(sub['submittedDate']) } | |
last_sub = submissions.last | |
last_sub['reviewSummation'][0]['metadata']['testScores'].each do |row| | |
puts "seed: %12d, score: %8d" % [row['testcase'], row['score']] | |
end | |
puts last_sub['reviewSummation'][0]['aggregateScore'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment