Skip to content

Instantly share code, notes, and snippets.

@pastak pastak/twilogCopy.js
Last active Feb 10, 2016

Embed
What would you like to do?
(()=>{
'use strict'
Array.from($$('.tl-tweet')).forEach((node) => {
try{
const twiUrl = node.querySelector('.tl-posted > a').href
const twiText = node.querySelector('.tl-text').textContent
const copyText = `[${twiUrl}:embed#${twiText}]`
let textInput = document.createElement('input')
node.appendChild(textInput)
textInput.style.width = '100%'
textInput.readonly = true
textInput.value = copyText
textInput.addEventListener('click', (event) => {event.target.select()})
}catch(e){}
})
})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.