Skip to content

Instantly share code, notes, and snippets.

@imlucas
Created October 5, 2009 02:27
Show Gist options
  • Save imlucas/201797 to your computer and use it in GitHub Desktop.
Save imlucas/201797 to your computer and use it in GitHub Desktop.
if($('link[href=http://gist.github.com/stylesheets/gist/embed.css]').length==0){
$('head').append('<link rel="stylesheet" type="text/css" media="screen" href="http://gist.github.com/stylesheets/gist/embed.css" />');
}
var g = 'http://gist.github.com/';
$('.content a[href^='+g+']').each(function(){
var el = $(this);
var gist_json_url = el.attr('href')+'.json';
$.getJSON('http://pipes.yahoo.com/pipes/pipe.run?_callback=?&_render=json&_id=f6840497e732806602852e40bc38cacc&gist_url='+encodeURIComponent(gist_json_url), function(d){
var gist = d.value.items[0].gist;
$(gist).insertAfter(el);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment