Skip to content

Instantly share code, notes, and snippets.

@ralphbean
Created July 4, 2012 19:52
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ralphbean/3049242 to your computer and use it in GitHub Desktop.
Save ralphbean/3049242 to your computer and use it in GitHub Desktop.
Having fun with coderwall
""" 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)
@dtgay
Copy link

dtgay commented Jul 4, 2012

I made some changes, pull them in if you'd like. :) https://gist.github.com/3049754

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment