Skip to content

Instantly share code, notes, and snippets.

@kyoto
Created July 10, 2011 09:13
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kyoto/1074399 to your computer and use it in GitHub Desktop.
Save kyoto/1074399 to your computer and use it in GitHub Desktop.
Coderwall Badge Script for Blogs (or any other Web Page)
# coderwall.coffee
# Display coderwall.com badges
username = "hermanjunge"
el = $(".coderwall")
$.getJSON "http://www.coderwall.com/#{username}.json?callback=?", (data) ->
el.empty()
for item in data.data.badges
$("<img>")
.attr(
src: item.badge
float: "left"
title: "#{item.name}: #{item.description}"
alt: item.name
height: 75
width: 75
)
.appendTo(el)
.hover((-> $(@).css "opacity", "0.6"), (-> $(@).css "opacity", "1.0"))
.wrap("<a href=\"http://www.coderwall.com/#{username}\" target=\"_blank\">")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment