Created
July 4, 2012 19:52
-
-
Save ralphbean/3049242 to your computer and use it in GitHub Desktop.
Having fun with coderwall
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
""" Run like: $ python coder-shell.py | |
First you need to: $ pip install coderwall requests fabulous | |
""" | |
from coderwall import CoderWall | |
import fabulous.image | |
import fabulous.text | |
import os | |
import requests | |
import tempfile | |
username = 'ralphbean' | |
user = CoderWall(username) | |
print(user.name) | |
for badge in user.badges: | |
url = badge.image_uri | |
response = requests.get(url) | |
fd, filename = tempfile.mkstemp(suffix='.png') | |
with open(filename, 'w') as f: | |
f.write(response.raw.data) | |
fab = fabulous.image.Image(filename) | |
os.remove(filename) | |
print(fab) | |
print(fabulous.text.Text(badge.name)) | |
print(badge.description) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I made some changes, pull them in if you'd like. :) https://gist.github.com/3049754