Created
July 29, 2011 04:40
-
-
Save tkawa/1113143 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
replaceUrl: function (elem, link, url) { | |
if (url.indexOf(twitterURL) == 0 || url.indexOf("javascript:") == 0) | |
return; // skip @... or #... | |
} else if (url.match(/^(http:\/\/4sq.com\/\w+)$/)) { | |
var _url = url; | |
xds.load('http://api.embed.ly/1/oembed?url='+encodeURIComponent(url), | |
function(x) { | |
var p = x.thumbnail_url; | |
if (!p) return; | |
addThumbnail(elem, p, _url); | |
}, | |
null, 1, 'callback'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment