Created
February 22, 2026 18:09
-
-
Save abnrk/270f820cd8a2144952e37063c9ca97df to your computer and use it in GitHub Desktop.
This file contains hidden or 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 4wiby | |
| // @namespace Violentmonkey Scripts | |
| // @match https://wiby.me/?* | |
| // @grant GM_xmlhttpRequest | |
| // @version 1.0 | |
| // @author Adudo | |
| // @description Mixes Wiby results with 4get results | |
| // ==/UserScript== | |
| function escapeHTML(str) { | |
| return new Option(str).innerHTML; | |
| } | |
| var params = new URLSearchParams(window.location.search); | |
| var links = document.querySelectorAll("blockquote:has(.tlink)"); | |
| var instance = "https://4get.nadeko.net"; | |
| var url = instance+"/api/v1/web?s="+params.get("q"); | |
| if(params.has("p")) { | |
| url = url+"&npt="+document.cookie; | |
| } | |
| GM_xmlhttpRequest({method:"GET",url:url,onload:function(response){ | |
| var responseJSON = JSON.parse(response.responseText); | |
| if(responseJSON["status"] == "ok") { | |
| var results = responseJSON["web"]; | |
| document.cookie = responseJSON["npt"]; | |
| for(var i=0;i<results.length;i++) { | |
| var result = results[i]; | |
| var resultElem = document.createElement("blockquote") | |
| resultElem.innerHTML = `<a class="tlink" href="${result["url"]}">${escapeHTML(result["title"])}</a><br><p class="url">${escapeHTML(result["url"])}</p><p>${escapeHTML(result["description"])}</p>`; | |
| document.body.insertBefore(resultElem,links[Math.floor(Math.random())*links.length]); | |
| } | |
| } else { | |
| var errorElem = document.createElement("blockquote"); | |
| errorElem.innerHTML = `<p>${escapeHTML(responseJSON["status"])}</p>`; | |
| document.body.insertBefore(errorElem,links[0]); | |
| } | |
| }}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment