Skip to content

Instantly share code, notes, and snippets.

@itamarhaber
Created February 11, 2015 16:56
Show Gist options
  • Save itamarhaber/ad9d6220221aeb7fb352 to your computer and use it in GitHub Desktop.
Save itamarhaber/ad9d6220221aeb7fb352 to your computer and use it in GitHub Desktop.
javascript:{function replaceTokens(e,t){var n=e;for(var r in t){n=n.replace(RegExp("[$]"+r,"g"),t[r])}return n}function copyTweetForOverheard(){var e=$(".js-original-tweet");var t={fullname:$(".fullname.js-action-profile-name.show-popup-with-id",e).text(),username:$(".username",e).text(),text:$(".tweet-text",e).text(),url:window.location.href};var n='\t\t\t\t<p style="margin-top: 8px; margin-bottom: 36px;"><strong style="color: rgb(42, 130, 223); text-decoration: none;"><a href="$url" style="color: rgb(42, 130, 223); text-decoration: none;" target="_blank">$fullname $username:</a></strong>&nbsp;&quot;$text&quot;</p>';alert(replaceTokens(n,t))}copyTweetForOverheard()}
@mbbroberg
Copy link

@itamarhaber can I pick your brain on how you run this? I'm not JS savvy myself

@itamarhaber
Copy link
Author

@mjbrender just noticed this question - sure, I put it as a bookmark(let) and whenever I see a tweet that I want to copy-paste to the newsletter I just click the bookmark to open the popup, do CTRL-C and then I can CTRL-V into my draft.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment