Skip to content

Instantly share code, notes, and snippets.

@psenough
Last active March 25, 2023 22:41
Show Gist options
  • Save psenough/5087e9c4904c30e91f8618f123851d66 to your computer and use it in GitHub Desktop.
Save psenough/5087e9c4904c30e91f8618f123851d66 to your computer and use it in GitHub Desktop.
Demozoo scene.org search userscript
// ==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