Skip to content

Instantly share code, notes, and snippets.

@pastak
Last active February 10, 2016 16:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pastak/dc28e20b48eee1a813a5 to your computer and use it in GitHub Desktop.
Save pastak/dc28e20b48eee1a813a5 to your computer and use it in GitHub Desktop.
(()=>{
'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