22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
-
+
+
+
+
|
'''
url = nb_url + 'api/login'
results = requests.post(url, data={"username": username, "password": password})
print "results.cookies =", results.cookies
print type(results.cookies)
self.cookies = results.cookies
return simplejson.loads(results.content)
results = simplejson.loads(results.content)
if results["authenticated"] is False:
raise Exception("The newsblur credentials you provided are invalid")
return results
def logout(self, ):
'''
Logout the currently logged in user.
'''
url = nb_url + 'api/logout'
|