tweet2image
https://tweet-card.now.sh/1273995449804795904.jpg?lang=ja https://twitter.com/SnO2WMaN/status/1273995449804795904
便利 Scrapbox記法もあるのかなりいい
code:userscript.js
const tweetURLRegex = /x.com\/(.+)\/status\/(\d+)/
scrapbox.PopupMenu.addButton({
title: text => tweetURLRegex.test(text) ? "tweet-card" : null,
onClick: (text) => {
const m = text.match(tweetURLRegex);
if (!m) return text;
return [https://tweet-card.now.sh/${m[2]}.jpg?lang=ja https://twitter.com/${m[1]}/status/${m[2]}];
},
});