From 4c14f36ab73f227bdd7ed636667d8035c33986e0 Mon Sep 17 00:00:00 2001 From: François Schmidts Date: Wed, 29 Oct 2014 14:32:24 +0100 Subject: global esthetics tweak --- pyaggr3g470r/lib/__init__.py | 0 pyaggr3g470r/lib/client.py | 16 ++++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 pyaggr3g470r/lib/__init__.py create mode 100755 pyaggr3g470r/lib/client.py (limited to 'pyaggr3g470r/lib') diff --git a/pyaggr3g470r/lib/__init__.py b/pyaggr3g470r/lib/__init__.py new file mode 100644 index 00000000..e69de29b 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 -- cgit