Skip to content

Instantly share code, notes, and snippets.

@prail
Created November 14, 2021 03:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save prail/fdfebc6745d87504581a8afc9a6d712f to your computer and use it in GitHub Desktop.
Save prail/fdfebc6745d87504581a8afc9a6d712f to your computer and use it in GitHub Desktop.
PCC Stalker Directory
// ==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}">`;
}
}
})();
@prail
Copy link
Author

prail commented May 19, 2023

To install you'll need to download either Tampermonkey or Greasemonkey depending on if you use Chrome or Firefox. Should work in both.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment