spotify2image
code:script.js
const spotifyRegex = /open.spotify.com\/(album|artist|playlist|track)\/(.+)/
scrapbox.PopupMenu.addButton({
title: text => spotifyRegex.test(text) ? "Spotify" : null,
onClick: (text) => {
const m = text.match(spotifyRegex);
if (!m) return text;
return [https://spotify2image.vercel.app/image/${m[1]}/${m[2]}#.png https://open.spotify.com/${m[1]}/${m[2]}];
},
});