diff options
Diffstat (limited to 'pyaggr3g470r/lib/client.py')
-rwxr-xr-x | pyaggr3g470r/lib/client.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/pyaggr3g470r/lib/client.py b/pyaggr3g470r/lib/client.py new file mode 100755 index 00000000..da6b1727 --- /dev/null +++ b/pyaggr3g470r/lib/client.py @@ -0,0 +1,16 @@ +#!/usr/bin/env python +import json +import requests +URL = 'domain.net' + + +def get_client(email, password): + client = requests.session() + client.get(URL + 'api/csrf', verify=False, + data=json.dumps({'email': email, + 'password': password})) + return client + + +def get_articles(client): + return client.get(URL + 'api/v1.0/articles/').json |