Created
November 15, 2014 08:26
-
-
Save jmakeig/b9397e7f57244f0b43b5 to your computer and use it in GitHub Desktop.
Load Jeopardy data
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
declareUpdate(); | |
// Hopefully this link doesn't go away. | |
var loc="https://doc-0s-1s-docs.googleusercontent.com/docs/securesc/ha0ro937gcuc7l7deffksulhg5h7mbp1/108nt093kbmcafeksihop0r1pcmkkvtr/1416031200000/14044389733472591834/*/0BwT5wj_P7BKXb2hfM3d2RHU1ckE?e=download"; | |
var qs=xdmp.documentGet(loc, {format: "json"}); | |
var shows = {}; | |
qs.next().value.toObject().forEach( | |
function(q) { | |
shows["" + q.show_number] = (shows["" + q.show_number]) ? shows["" + q.show_number] + 1 : 1; | |
var uri = "/" + q.show_number + "_" + shows["" + q.show_number] + ".json"; | |
// Has no one actually watched the show? | |
var question = q.answer; | |
q.answer = q.question; | |
q.question = question; | |
xdmp.documentInsert(uri, q, xdmp.defaultPermissions(), ["jeopardy"]); | |
} | |
); | |
shows; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment