Created
August 2, 2012 16:13
-
-
Save dtgay/3238297 to your computer and use it in GitHub Desktop.
Coderwall API example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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