Skip to content

Instantly share code, notes, and snippets.

@tkawa
Created July 29, 2011 04:40
Show Gist options
  • Save tkawa/1113143 to your computer and use it in GitHub Desktop.
Save tkawa/1113143 to your computer and use it in GitHub Desktop.
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