Skip to content

Instantly share code, notes, and snippets.

@dtgay
Created August 2, 2012 16:13
Show Gist options
  • Save dtgay/3238297 to your computer and use it in GitHub Desktop.
Save dtgay/3238297 to your computer and use it in GitHub Desktop.
Coderwall API example
def handle_coderwall(request, username):
"""
Get data from CoderWall.
"""
from coderwall import CoderWall
try:
cwc = CoderWall(username)
return {
'endorsements': cwc.endorsements,
'badges': len(cwc.badges),
'cwc': cwc,
}
except NameError:
request.session.flash(
'Error: Unable to find username on Coderwall.')
return None
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment