Skip to content

Instantly share code, notes, and snippets.

@mbbroberg
Forked from itamarhaber/Redis_Watch_Quote_Tweet.js
Last active August 29, 2015 14:15
Show Gist options
  • Save mbbroberg/db41d70a488bdfdedee6 to your computer and use it in GitHub Desktop.
Save mbbroberg/db41d70a488bdfdedee6 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()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment