Last active
October 2, 2022 13:41
-
-
Save fredgido/1a6fd1e92c79c67c9eda19019d1caa22 to your computer and use it in GitHub Desktop.
Look Into The Deep ai
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 lazy mode press \ | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author You | |
// @match https://aibooru.online/uploads/* | |
// @match https://aibooru.online/posts/* | |
// @grant none | |
// @run-at document-idle | |
// ==/UserScript== | |
window.addEventListener("keypress", myEventHandler, false); | |
function myEventHandler(e) { | |
var keyCode = e.keyCode; | |
console.log(e, keyCode, e.which) | |
if (keyCode == 92) { | |
try{ | |
document.getElementsByClassName("deep-tags-column")[0].getElementsByTagName("span")[0].click(); | |
document.querySelector("form input[name='commit']").click(); | |
} | |
catch{ | |
return ;} | |
console.log("You pressed W!"); | |
//alert("You pressed W!"); | |
} | |
}; |
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 Look Into The Deep ai | |
// @namespace LITD | |
// @version 1.0 | |
// @description ... | |
// @author made by fredgy-kun | |
// @match https://aibooru.online/uploads/* | |
// @match https://aibooru.online/posts/* | |
// @connect deepdanbooru.donmai.us | |
// @grant GM.xmlHttpRequest | |
// @run-at document-idle | |
// @downloadURL https://gist.github.com/fredgido/293a701de7153f48f5770e77280c88e1/raw/LITD.user.js | |
// @updateURL https://gist.github.com/fredgido/293a701de7153f48f5770e77280c88e1/raw/LITD.user.js | |
// ==/UserScript== | |
function allSelector(){ | |
const deepTagsColumn = document.getElementsByClassName("deep-tags-column"); | |
const tags = deepTagsColumn[0].getElementsByTagName("li"); | |
for (let item of tags) { | |
if (!item.classList.contains("selected")){ | |
item.children[0].click(); | |
}; | |
} | |
const translatedTagsColumn = document.getElementsByClassName("translated-tags-related-tags-column"); | |
const translatedtags = translatedTagsColumn[0].getElementsByTagName("li"); | |
for (let item of translatedtags) { | |
if (!item.classList.contains("selected")){ | |
item.children[0].click(); | |
}; | |
} | |
} | |
document.allSelector = allSelector; | |
function changer(event) { | |
let url = new URL(document.querySelector("#image, .media-asset-image").src); | |
if (url.pathname === "/uploads/image_proxy") { | |
url = url.searchParams.get("url") | |
}; | |
GM.xmlHttpRequest({ | |
method: "GET", | |
url: "https://deepdanbooru.donmai.us/evaluate?min_score=0.1&url=" + encodeURIComponent(String(url)), | |
onload: function (response) { | |
var htmlinsert = [`<div class="tag-column deep-tags-column is-empty-false"> <h3 class="flex items-center space-x-1"><input type="checkbox" class="invisible"><span onclick="document.allSelector()" >Deep<span></h3><ul> `, `</ul> </div>`]; | |
htmlinsert.splice(1, 0, JSON.parse(response.responseText).map(k => `<li class="flex items-center space-x-1"><input type="checkbox" tabindex="-1"><a class="search-tag tag-type-0 selected" data-tag-name="${k[0]}" href="/posts?tags=${k[0]}">${k[0]}</a></li>`).join("")); | |
htmlinsert = htmlinsert.join(""); | |
document.getElementsByClassName("related-tags")[0].innerHTML += htmlinsert; | |
Danbooru.RelatedTag.update_selected(); | |
} | |
}); | |
} | |
if( location.href.match(/https?:\/\/aibooru\.online\/uploads\/\d+/) && document.querySelector(".media-asset-image").src.length > 1) | |
changer(); | |
else | |
document.getElementById("post-edit-link").onclick = changer; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment