Last active
March 25, 2023 22:41
-
-
Save psenough/5087e9c4904c30e91f8618f123851d66 to your computer and use it in GitHub Desktop.
Demozoo scene.org search userscript
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 Demozoo scene.org search | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author You | |
// @match https://demozoo.org/* | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=demozoo.org | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
var res = document.getElementsByClassName("download_link"); | |
for (var i = 0; i < res.length; i++) { | |
var url = res[i].childNodes[1].childNodes[0].href; | |
var filename = url.substring(url.lastIndexOf('/')+1); | |
var sceneorgsearch = "https://files.scene.org/search/?q="+filename; | |
console.log(sceneorgsearch); | |
res[i].childNodes[1].childNodes[0].innerHTML += ' <a href="'+sceneorgsearch+'" class="secondary">(search scene.org)</a>'; | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment