Danbooru Tag Extractor

Extracts data-tag-name values from a Danbooru page

이 스크립트를 설치하려면 Tampermonkey, Greasemonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Userscripts와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 유저 스크립트 관리자 확장 프로그램이 필요합니다.

(이미 유저 스크립트 관리자가 설치되어 있습니다. 설치를 진행합니다!)

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

(이미 유저 스타일 관리자가 설치되어 있습니다. 설치를 진행합니다!)

// ==UserScript==
// @name         Danbooru Tag Extractor
// @version      1.3.1
// @description  Extracts data-tag-name values from a Danbooru page
// @author       Nina_
// @match        https://danbooru.donmai.us/posts/*
// @grant        none
// @license MIT
// @namespace https://greasyfork.org/users/1387362
// ==/UserScript==

(function() {
    'use strict';

    window.addEventListener('load', function() {

        const tags = document.querySelectorAll('[data-tag-name]');

        const tagNames = Array.from(tags).map(tag => tag.getAttribute('data-tag-name'));

        const tagString = tagNames.join(', ');

        console.log(tagString);

        const outputElement = document.createElement('div');
        outputElement.style.position = 'fixed';
        outputElement.style.bottom = '10%'; //Position
        outputElement.style.right = '10%'; //Position
        outputElement.style.width = '500px'; // Initial width
        outputElement.style.height = '300px'; // Initial height
        outputElement.style.backgroundColor = 'white';
        outputElement.style.padding = '10px';
        outputElement.style.border = '1px solid black';
        outputElement.style.color = 'black';
        outputElement.style.resize = 'both';
        outputElement.style.overflow = 'auto';
        outputElement.textContent = tagString;
        document.body.appendChild(outputElement);
    });
})();


/*
 * Greasy Fork Description:
 * This userscript extracts all tags (data-tag-name) from Danbooru posts and displays them in a box at the bottom-right corner of the page.
 * It allows users to easily copy the tags for use in other applications. The initial size of the box is set to 500x300 pixels.
 *
 * Greasy Fork 简介:
 * 这个脚本会从 Danbooru 帖子中提取所有标签(data-tag-name),并将它们显示在页面右下角的一个框中。标签以英文逗号分隔开。
 * 用户可以方便地复制这些标签用于其他应用程序。初始框的大小设置为 500x300 像素。
 */