Last active
April 12, 2019 15:48
-
-
Save glefait/81bb20a32fbca33586b65adf993b0288 to your computer and use it in GitHub Desktop.
decode Google Code Competition data
This file contains hidden or 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
var googleCodeDecode = function (e) { | |
return JSON.parse(atob(e.replace(/[-_]/g, function(e) { return "-" == e ? "+" : "/" }).replace(/[^A-Za-z0-9\+\/]/g, ""))); | |
} | |
var googleCodeEncode = function (e) { | |
return btoa(JSON.stringify(e)).replace(/[+/]/g, function(e) { return "+" == e ? "-" : "_" }).replace(/[^A-Za-z0-9\+\/]/g, ""))); | |
} | |
params = {"min_rank": 1, "num_consecutive_users": 100}; | |
// url example to get the first 100 results: | |
// https://codejam.googleapis.com/scoreboard/0000000000051705/poll?p=eyJtaW5fcmFuayI6MSwibnVtX2NvbnNlY3V0aXZlX3VzZXJzIjoxMDB9 | |
// where param p value comes from googleCodeEncode(params) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment