Twitterの会話をScrapboxに貼れるようにするScript
code:script.js
Array.from(document.querySelectorAll('.permalink-container .tweet'))
.map((e, i) => {
const username = e.querySelector('.username b').textContent
const text = e.querySelector('.tweet-text').textContent
const path = e.getAttribute('data-permalink-path')
const link = ${location.protocol}//${location.host}${path}
// const indent = ' '.repeat(i)
return > [${username} ${link}] ${text}
} )
.join('\n')