Created
February 22, 2014 22:44
-
-
Save ear1grey/9163511 to your computer and use it in GitHub Desktop.
Scrape the list of students on a unit from the staff portal at Uni of Portsmouth, as JSON.
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
(function() { | |
var i, y, result = [], x = document.querySelectorAll("input[type=checkbox]"); | |
for (i in x) { | |
y = x[i].defaultValue; | |
if (y) { | |
var r = {} | |
r.orig = y; | |
r.email = y.split(",")[0].trim(); | |
r.name = y.split(",")[1].trim(); | |
r.jupiter = r.email.substr(2).replace('@myport.ac.uk', ''); | |
result.push( r ); | |
}; | |
} | |
return JSON.stringify(result); | |
}()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment