UserScript:井戸端
井戸端投稿支援スクリプト(ではないか)
script.js scrapbox.PopupMenu.addButton({
title: '🕳️井戸端',
onClick: text => {
const lines = text
.split(/[\r\n]/)
.map(line => line.replace(/[\[\]\r\n]/g, '').replace(/^\s+/, ''))
const now = new Date().toLocaleString()
if (scrapbox.Project.name==="suto3") {
const url = `https://scrapbox.io/villagepump/suto3の大福帳?body=${now} ${encodeURIComponent(lines.join('\n'))} [/${scrapbox.Project.name}/${scrapbox.Page.title}]`
//const url = `https://scrapbox.io/suto3scratchpad/sandbox?body= ${now} :${encodeURIComponent(lines)} [/${scrapbox.Project.name}/${scrapbox.Page.title}]`
//console.log(url)
window.open(url)
} else {
const url = `https://scrapbox.io/suto3/一時保存?body= ${now} :${encodeURIComponent(lines)} [/${scrapbox.Project.name}/${scrapbox.Page.title}]`
//console.log(url)
window.open(url)
}
}
})
改行が入ってしまうのが残念
元ネタ