Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@jphastings
Created May 20, 2009 20:01
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 jphastings/115054 to your computer and use it in GitHub Desktop.
Save jphastings/115054 to your computer and use it in GitHub Desktop.
// Lets javascript add twitter links to @reply style text items in any selected html elements
// Requires MooTools' selectors
function tumblrTweets(selector) {
$$(selector).each(function(t) {
t.set('html',t.get('html').replace(/@([a-zA-Z0-9_]+)/,"<a href=\"http://twitter.com/$1\">$1</a>"));
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment