Skip to content

Instantly share code, notes, and snippets.

@AaronFoltz
Created August 12, 2011 02:36
Show Gist options
  • Save AaronFoltz/1141325 to your computer and use it in GitHub Desktop.
Save AaronFoltz/1141325 to your computer and use it in GitHub Desktop.
Coderwall Badge Script for Blogs (or any other Web Page)
/*
*
* coderwall.js
*
* Code to display coderwall.com badges
*
*/
var coderwallJSONurl ="http://www.coderwall.com/hermanjunge.json?callback=?";
var height = 75;
var width = 75;
$(document).ready(function(){
$.getJSON(coderwallJSONurl, function(data) {
$.each(data.data.badges, function(i, item) {
$("<img/>").attr("src", item.badge)
.attr("float", "left")
.attr("title", item.name + ": " + item.description)
.attr("alt", item.name)
.attr("height", height)
.attr("width", width)
.appendTo("#coderwall")
.hover(
function(){
$(this).css("opacity","0.6");
},
function(){
$(this).css("opacity","1.0");
}
)
.click(
function(){
window.location = "http://www.coderwall.com/hermanjunge/";
}
);
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment