Skip to content

Instantly share code, notes, and snippets.

@yanknvim
Last active April 14, 2024 09:55
Show Gist options
  • Save yanknvim/7051ed50247292d2f148f13c3ea1cf29 to your computer and use it in GitHub Desktop.
Save yanknvim/7051ed50247292d2f148f13c3ea1cf29 to your computer and use it in GitHub Desktop.
Boothの商品ページからIDで検索できるやつ

Booth Id Search

Boothで対応アバターなんかを検索するときに商品IDで検索することが面倒だったので、それをするボタンを追加するUserScriptです

導入

Tampermonkeyなどを導入してRawをクリーック!かんたん!

// ==UserScript==
// @name Booth Item Search
// @namespace https://uneu.net/
// @version 1.0.1
// @description Boothの商品ページからIDで検索できるやつ
// @author yank.nvim
// @match https://booth.pm/*/items/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
var container = document.getElementById("js-item-share-buttons").parentNode;
var searchButton = document.createElement("button");
searchButton.className = "id-search-button";
searchButton.innerHTML = "Search by ID"
searchButton.addEventListener("click", () => {
var url = new URL(location.href);
var lang = url.pathname.split('/')[1];
var id = url.pathname.split('/')[3];
var searchUrl = new URL(`https://booth.pm/${lang}/search/${id}`);
window.open(searchUrl);
});
container.appendChild(searchButton);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment