UserScript:Scaffolding
Level 1 基本語彙
code:scriptxx.js
const l1links = text => {
const regexp = /^[a-zA-Z0-9!-/:-@\-`{-~\s*$/gm if (regexp.test(text)) {
return [https://ejje.weblio.jp/content/${text}]\n
+ [https://www.ldoceonline.com/dictionary/${text}]\n
+ [https://www.dictionary.com/browse/${text}]\n
+ [https://www.thesaurus.com/browse/${text}]\n
+ [https://jisho.org/search/${text}]\n
} else {
return weblio [https://www.weblio.jp/content/${encodeURIComponent(text)} ${text}]\n
+ kotobank [https://kotobank.jp/gs/?q=${encodeURIComponent(text)} ${text}]\n
+ jisho [https://jisho.org/search/${encodeURIComponent(text)} ${text}]\n
}
}
scrapbox.PopupMenu.addButton({
title: 'L1',
onClick: l1links
})
Level 2 辞書に載っていそうなこと
code:scriptxx.js
const l2links = text => {
const regexp = /^[a-zA-Z0-9!-/:-@\-`{-~\s*$/gm if (regexp.test(text)) {
return wikipedia [https://en.wikipedia.org/w/index.php?search=${encodeURIComponent(text)} ${text}]\n
+ weblio [https://ejje.weblio.jp/content/${encodeURIComponent(text)} ${text}]\n
+ kotobank [https://kotobank.jp/gs/?q=${encodeURIComponent(text)} ${text}]\n
+ jisho [https://jisho.org/search/${encodeURIComponent(text)} ${text}]
} else {
return wikipedia [https://ja.wikipedia.org/w/index.php?search=${encodeURIComponent(text)} ${text}]\n
+ weblio [https://www.weblio.jp/content/${encodeURIComponent(text)} ${text}]\n
+ kotobank [https://kotobank.jp/gs/?q=${encodeURIComponent(text)} ${text}]\n
+ jisho [https://jisho.org/search/${encodeURIComponent(text)} ${text}]
}
}
scrapbox.PopupMenu.addButton({
title: 'L2',
onClick: l2links
})
Level 3 辞書に載ってなさそうなこと
code:scriptxx.js
const l3links = text => {
const regexp = /^[a-zA-Z0-9!-/:-@\-`{-~\s*$/gm if (regexp.test(text)) {
return [google.icon][https://www.google.com/search?q=${encodeURI(text.replace(' ', '+'))} ${text}]\n
+ image [https://www.google.com/search?q=${encodeURI(text.replace(' ', '+'))}&tbm=isch ${text}]\n
+ define [https://www.google.com/search?q=${encodeURI(text.replace(' ', '+'))}+define ${text}]
} else {
return [google.icon][https://www.google.com/search?q=${encodeURI(text.replace(' ', '+'))} ${text}]\n
+ 画像 [https://www.google.com/search?q=${encodeURI(text.replace(' ', '+'))}&tbm=isch ${text}]\n
+ 定義 [https://www.google.com/search?q=${encodeURI(text.replace(' ', '+')+'+定義')} ${text}]
}
}
scrapbox.PopupMenu.addButton({
title: 'L3',
onClick: l3links
})
Level 4 画像検索特化
code:scriptxx.js
const l4links = text => {
return [/icons/google.icon][https://www.google.com/search?q=${encodeURI(text.replace(' ', '+'))}&tbm=isch ${text}]\n
+ [/icons/pinterest.icon][https://www.pinterest.jp/search/pins/?q=${encodeURI(text.replace(' ', '+'))} ${text}]
}
scrapbox.PopupMenu.addButton({
title: 'L4',
onClick: l4links
})
Level 5 インターネットスラング
code:scriptxx.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
})
Level 6 プログラミング特化
code:scriptxx.js
const l6links = text => {
return [/icons/qiita.icon][https://qiita.com/search?q=${encodeURI(text.replace(' ', '+'))} ${text}]\n
+ [/icons/github.icon][https://github.com/search?q=${encodeURI(text.replace(' ', '+'))} ${text}]
}
scrapbox.PopupMenu.addButton({
title: 'L6',
onClick: l6links
})
x1 基本
code:script.js
const x1links = text => {
const regexp = /^[a-zA-Z0-9!-/:-@\-`{-~\s*$/gm if (regexp.test(text)) {
return [/suto3/google.icon][https://www.google.com/search?q=${encodeURI(text.replace(' ', '+'))} ${text}]\n
+ [/suto3/Google画像検索.icon][https://www.google.com/search?q=${encodeURI(text.replace(' ', '+'))}&tbm=isch ${text}]\n
+ [/suto3/Google定義検索.icon] [https://www.google.com/search?q=${encodeURI(text.replace(' ', '+'))}+define ${text}]\n
+ [/suto3/wikipedia.icon][https://en.wikipedia.org/w/index.php?search=${encodeURIComponent(text)} ${text}]\n
+ [/suto3/weblio.icon] [https://ejje.weblio.jp/content/${encodeURIComponent(text)} ${text}]\n
+ [/suto3/kotobank.icon] [https://kotobank.jp/gs/?q=${encodeURIComponent(text)} ${text}]\n
+ [/suto3/jisho.icon] [https://jisho.org/search/${encodeURIComponent(text)} ${text}]
} else {
return [/suto3/google.icon][https://www.google.com/search?q=${encodeURI(text.replace(' ', '+'))} ${text}]\n
+ 画像 [https://www.google.com/search?q=${encodeURI(text.replace(' ', '+'))}&tbm=isch ${text}]\n
+ 定義 [https://www.google.com/search?q=${encodeURI(text.replace(' ', '+')+'+定義')} ${text}]\n
+ wikipedia [https://ja.wikipedia.org/w/index.php?search=${encodeURIComponent(text)} ${text}]\n
+ weblio [https://www.weblio.jp/content/${encodeURIComponent(text)} ${text}]\n
+ kotobank [https://kotobank.jp/gs/?q=${encodeURIComponent(text)} ${text}]\n
+ jisho [https://jisho.org/search/${encodeURIComponent(text)} ${text}]
}
}
scrapbox.PopupMenu.addButton({
title: '🪜',
//title: text => {return('✳' + text)},
onClick: x1links
})
UserScript.icon
https://img.shields.io/badge/JavaScript-UserScript_Scaffolding-F7DF1E.svg?logo=javascript&style=for-the-badge