Skip to content

Instantly share code, notes, and snippets.

@kopiro
Created August 2, 2011 13:03
Show Gist options
  • Save kopiro/1120129 to your computer and use it in GitHub Desktop.
Save kopiro/1120129 to your computer and use it in GitHub Desktop.
Get the GIST snippets (syntax-highlited) with jQuery
var snippets = [];
function loadSnippets() {
snippetsdiv = $("#snippets-feed");
$.ajax({
url: "http://ajax.googleapis.com/ajax/services/feed/load?v=1.0&num=10&callback=?&q="+encodeURIComponent("https://gist.github.com/kopiro.atom"),
dataType: "json",
success: function (data) {
snippets = data.responseData.feed.entries;
$.each(snippets, function(k,v) {
$.getJSON(v.link+".json?callback=?", function(j){
snippetsdiv.append("<h5>"+j.description+"</h5>");
snippetsdiv.append(j.div);
});
});
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment