generated at
UserScript:Popup-Tweet
TwitterでつぶやくスクリプトPopupMenu版
選択されたテキストをTwitterでつぶやく
scriptxx.js
scrapbox.PopupMenu.addButton({ title: function (text) { const chars = 117 - text.replace(/[\r\n]|\[|\]/g, '').length return `Tw ${chars}C` }, onClick: text => (text.replace(/[\r\n]|\[|\]/g, '').length < 117) ? window.open(`https://twitter.com/intent/tweet?url=${encodeURIComponent(location.href)}&text=${encodeURIComponent(text.replace(/\[|\]/g,""))}`) : window.open(`https://twitter.com/intent/tweet?url=${encodeURIComponent(location.href)}&text=${encodeURIComponent(text.replace(/\[|\]/g,"").substr(0,116)+"…")}`) })

script.js
scrapbox.PopupMenu.addButton({ title: function (text) { const ttext = scrapbox.Page.title + "\n" + text const chars = 117 - text.replace(/[\r\n]|\[|\]/g, '').length return `TT ${chars}C` }, onClick: text => { const twtext = scrapbox.Page.title + "\n" + text return (twtext.replace(/[\r\n]|\[|\]/g, '').length < 117) ? window.open(`https://twitter.com/intent/tweet?url=${encodeURIComponent(location.href)}&text=${encodeURIComponent(twtext.replace(/\[|\]/g,""))}`) : window.open(`https://twitter.com/intent/tweet?url=${encodeURIComponent(location.href)}&text=${encodeURIComponent(twtext.replace(/\[|\]/g,"").substr(0,116)+"…")}`) } })

元ネタ
うん、そのまんまだ。

UserScript:Page-Tweet -- ページメニュー版。考えなしにページの先頭からツイートする。

Twitter

UserScript