Skip to content

Instantly share code, notes, and snippets.

@nea89o
Last active February 7, 2020 17:38
Show Gist options
  • Save nea89o/7459a3ca6bbc217899685b6281c39b22 to your computer and use it in GitHub Desktop.
Save nea89o/7459a3ca6bbc217899685b6281c39b22 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Replace imgur links in the Abishirt vote with images
// @version 1
// @grant none
// @run-at document-end
// @include https://civs.cs.cornell.edu/cgi-bin/*
// ==/UserScript==
console.log("Replacing imgur links with embeded images");
function mutate(el){
el.innerHTML = el.innerHTML.replace(/https:\/\/imgur\.com\/([a-z0-9]+)/i, "<img src=\"https://i.imgur.com/$1.png\" height=200/>https://imgur.com/$1")
}
document.querySelectorAll("td").forEach(mutate)
document.querySelectorAll("th").forEach(mutate)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment