openbd_cover_from_isbn
頑張って書きたい,本の書影が合ったほうがまあ便利泣きがする
code:userscript.js
const isbnRegex = /^(\d{3}-?)?\d{10}$/ // TODO: ISBN10?
scrapbox.PopupMenu.addButton({
title: text => isbnRegex.test(text) ? "ISBN13" : null,
onClick: (text) => {
if (!text.match(isbnRegex)) return text;
return [https://cover.openbd.jp/${text.replace(/-/g,"")}.jpg];
},
});