aboutsummaryrefslogtreecommitdiff
path: root/pyaggr3g470r/lib/client.py
diff options
context:
space:
mode:
authorFrançois Schmidts <francois.schmidts@gmail.com>2014-10-29 14:32:24 +0100
committerFrançois Schmidts <francois.schmidts@gmail.com>2015-03-03 22:22:14 +0100
commit4c14f36ab73f227bdd7ed636667d8035c33986e0 (patch)
tree7deb8919953a72a93553f95b3643e75afdb75110 /pyaggr3g470r/lib/client.py
parentRelease 6.1. Updated NEWS.rst (diff)
downloadnewspipe-4c14f36ab73f227bdd7ed636667d8035c33986e0.tar.gz
newspipe-4c14f36ab73f227bdd7ed636667d8035c33986e0.tar.bz2
newspipe-4c14f36ab73f227bdd7ed636667d8035c33986e0.zip
global esthetics tweak
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