PCC Stalker Directory
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
// ==UserScript== | |
// @name Stalker Directory | |
// @version 1.0 | |
// @description Adds images to the PCC student (stalker) directory. | |
// @author Andrew | |
// @match https://eaglesnest.pcci.edu/studentservices/studentdirectory/ | |
// @icon https://www.google.com/s2/favicons?domain=pcci.edu | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
var rows = document.getElementById("ctl00_cphMainContent_gvResults").rows; | |
rows[0].insertCell(0).innerText="Picture"; | |
for (var e in rows) { | |
var row = rows[e], name = row.className; | |
if (name == "GridViewNormalRow" || name == "GridViewAlternatingRow") { | |
/* convert the row's SID to base 64, | |
so we can look it up with image API. */ | |
var b64RowSID = btoa(row.cells[0].textContent); | |
var studentImageURL = `https://eaglesnest.pcci.edu/MasterPages/Includes/GetImage.axd?imageID=${b64RowSID}&t=Y`; | |
row.insertCell(0).innerHTML = `<img src="${studentImageURL}">`; | |
} | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To install you'll need to download either Tampermonkey or Greasemonkey depending on if you use Chrome or Firefox. Should work in both.