UserScript:Scaffolding-05
code:script.js
const l5links = text => {
const regexp = /^[a-zA-Z0-9!-/:-@\-`{-~\s*$/gm if (regexp.test(text)) {
return [/icons/wikipedia.icon][https://en.wikipedia.org/w/index.php?search=${encodeURIComponent(text)} ${text}]\n
+ [/icons/google.icon][https://www.google.com/search?q=${encodeURI(text.replace(' ', '+'))} ${text}]\n
+ [/icons/twitter.icon][https://twitter.com/search?q=${encodeURI(text.replace(' ', '+'))} ${text}]\n
+ Urban Dictionary [https://www.urbandictionary.com/define.php?term=${encodeURI(text.replace(' ', '+'))} ${text}]
} else {
return [/icons/wikipedia.icon][https://ja.wikipedia.org/w/index.php?search=${encodeURIComponent(text)} ${text}]\n
+ [/icons/google.icon][https://www.google.com/search?q=${encodeURI(text.replace(' ', '+'))} ${text}]\n
+ [/icons/twitter.icon][https://twitter.com/search?q=${encodeURI(text.replace(' ', '+'))} ${text}]
}
}
scrapbox.PopupMenu.addButton({
title: 'L5',
onClick: l5links
})
UserScript.icon
https://img.shields.io/badge/JavaScript-UserScript_Scaffolding--05-F7DF1E.svg?logo=javascript&style=for-the-badge