您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Add more infomation for sakugabooru wiki
// ==UserScript== // @name Sakugabooru Tag Information // @namespace https://sakugabot.pw/ // @version 0.1 // @description Add more infomation for sakugabooru wiki // @author ElnathMojo // @include /^https?://(www\.sakugabooru\.com|sakuga\.yshi\.org)/(wiki/show\?title=|artist\/create\?name=).*/ // ==/UserScript== function isURL(str) { var pattern = /^https?:\/\/.+\..+$/ return pattern.test(str) } (function () { var title = /(?<=\?(title|name)=)(.+)/.exec(window.location.href)[0] jQuery.ajax({ url: `https://sakugabot.pw/api/tags/${title}/`, type: 'GET', dataType: 'json', success: function (result) { var infoTable = "" result.detail.forEach( function (element) { let value = element.formatted_value ? element.formatted_value : element.value let valueHtml = `<a>${value}</a>` if (isURL(value)) { valueHtml = ` <a href="${value}">${element.value}</a>` } infoTable += ` <tr> <th>${element.attribute.name}</th> <td> ${valueHtml} </td> </tr>` } ) infoTable = ` <div style="clear: both;"> <p><b>以下信息来自<a href="https://sakugabot.pw/">Sakugabot</a></b></p> <table class="form" style="margin-bottom: 1em;width: 15em;"> <tbody>${infoTable}</tbody> </table> <p>最后编辑者:${result.last_edit_user}</p> </div>` jQuery(infoTable).insertBefore('div.footer:eq(0)') } }) })()