projects
/
diaspy.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b356c9f
)
get_notifications() function
author
Moritz Kiefer
<moritz.kiefer@gmail.com>
Fri, 1 Feb 2013 22:38:16 +0000
(23:38 +0100)
committer
Moritz Kiefer
<moritz.kiefer@gmail.com>
Fri, 1 Feb 2013 22:38:16 +0000
(23:38 +0100)
diaspy/client.py
patch
|
blob
|
blame
|
history
diff --git
a/diaspy/client.py
b/diaspy/client.py
index 1807c201688ea462d32f8deac765c75e483a96ed..0a916706f1c2f2ec1e72ec865bfd02100fb35062 100644
(file)
--- a/
diaspy/client.py
+++ b/
diaspy/client.py
@@
-111,3
+111,20
@@
class Client:
posts.append(diaspy.models.Post(str(post['id']), self))
return posts
posts.append(diaspy.models.Post(str(post['id']), self))
return posts
+
+ def get_notifications(self):
+ """This functions returns a list of notifications.
+
+ :returns: list -- list of json formatted notifications
+
+ """
+
+
+ data = {'authenticity_token': self.get_token()}
+ r = self.session.get(self.pod + "/notifications.json")
+
+ if r.status_code != 200:
+ raise Exception('wrong status code: ' + str(r.status_code))
+
+ notifications = r.json()
+ return notifications