Permalink
Browse files

Changed coderwall to be user and refactored it

  • Loading branch information...
1 parent 93647d1 commit 3aee1d9da51b76c360269ae8c634ae351b76b7cc @joshbenham committed Sep 19, 2012
Showing with 27 additions and 24 deletions.
  1. +0 −24 coderwall/coderwall.py
  2. +27 −0 coderwall/user.py
View
@@ -1,24 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-coderwall.coderwall
-~~~~~~~~~~
-
-API for coderwall
-"""
-
-import json
-import requests
-
-class CoderWall:
-
- def __init__(self, username):
- response = requests.get('http://coderwall.com/%s.json' % (username))
-
- if response.status_code != 200:
- raise CoderWall_UserNotFoundError()
-
- self.user = json.loads(response.text)
-
-
-class CoderWall_UserNotFoundError(Exception): pass
View
@@ -0,0 +1,27 @@
+# -*- coding: utf-8 -*-
+
+"""
+coderwall.coderwall
+~~~~~~~~~~
+
+API for coderwall
+"""
+
+import json
+import requests
+
+
+class User:
+
+ def __init__(self, username):
+ """Query coderwall to fetch the user"""
+ response = requests.get('http://coderwall.com/%s.json' % (username))
+
+ if response.status_code != 200:
+ raise User_UserNotFoundError()
+
+ self.user = json.loads(response.text)
+
+
+class User_UserNotFoundError(Exception):
+ pass

0 comments on commit 3aee1d9

Please sign in to comment.