aboutsummaryrefslogtreecommitdiff
path: root/pyaggr3g470r/lib/client.py
diff options
context:
space:
mode:
Diffstat (limited to 'pyaggr3g470r/lib/client.py')
-rwxr-xr-xpyaggr3g470r/lib/client.py16
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
bgstack15