Skip to content

Instantly share code, notes, and snippets.

@NuarkNoir
Last active April 21, 2019 12:03
Show Gist options
  • Save NuarkNoir/d595fd9bf19075fac4d12d1ff0e008af to your computer and use it in GitHub Desktop.
Save NuarkNoir/d595fd9bf19075fac4d12d1ff0e008af to your computer and use it in GitHub Desktop.
Nozomi Tags Copier - Helps copy tags from nozomi.la
// ==UserScript==
// @name Nozomi Tags Copier
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Helps copy tags from nozomi.la
// @author Nuark
// @match https://nozomi.la/post/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
let sidebar;
window.zxc = function() {
let out = "";
let tags = sidebar.querySelectorAll("ul > li > a");
tags.forEach(x => {
if (x.classList.toString() !== "tag") out += x.classList.toString() + ":";
out += x.innerText.replace(/ /g, "_") + " ";
});
out = out.trim();
let input = document.createElement("input");
input.style = "width: 100%;";
input.type = "text";
input.value = out;
sidebar.prepend(input);
}
let init = function() {
let button = document.createElement("button");
button.innerText = "COPY TAGS";
button.style = "width: 100%;";
button.onclick = window.zxc;
sidebar = document.querySelector("div.sidebar");
sidebar.prepend(button);
}
init();
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment