aboutsummaryrefslogtreecommitdiff
path: root/README.rst
diff options
context:
space:
mode:
authorCédric Bonhomme <cedric@cedricbonhomme.org>2014-06-23 09:51:07 +0200
committerCédric Bonhomme <cedric@cedricbonhomme.org>2014-06-23 09:51:07 +0200
commit88180acfb56ef5ab758023bb33bbb92154bed93a (patch)
tree0b2630e6dd2310f2910d6a03abbc1d5480b66cd5 /README.rst
parentIt is now possible to add new articles with the API! (diff)
downloadnewspipe-88180acfb56ef5ab758023bb33bbb92154bed93a.tar.gz
newspipe-88180acfb56ef5ab758023bb33bbb92154bed93a.tar.bz2
newspipe-88180acfb56ef5ab758023bb33bbb92154bed93a.zip
Updated README.
Diffstat (limited to 'README.rst')
-rw-r--r--README.rst16
1 files changed, 16 insertions, 0 deletions
diff --git a/README.rst b/README.rst
index 53df6b52..be048e57 100644
--- a/README.rst
+++ b/README.rst
@@ -175,6 +175,22 @@ To get an article:
$ curl --user your-email:your-password "https://pyaggr3g470r.herokuapp.com/api/v1.0/articles/84566"
+Add an article:
+
+.. code:: python
+
+ >>> import requests, json
+ >>> headers = {'Content-type': 'application/json', 'Accept': 'application/json'}
+ >>> payload = {'link': 'http://blog.cedricbonhomme.org/2014/05/24/sortie-de-pyaggr3g470r-5-3/', 'title': 'Sortie de pyAggr3g470r 5.3', 'content':'La page principale de pyAggr3g470r a été améliorée...', 'date':str(datetime.datetime.now()), 'feed_id':'42'}
+ >>> r = requests.post("https://pyaggr3g470r.herokuapp.com/api/v1.0/articles/0", headers=headers, auth=("your-email", "your-password"), data=json.dumps(payload))
+ >>> print r.content
+ {
+ "message": "ok"
+ }
+ >>> r = requests.get("https://pyaggr3g470r.herokuapp.com/api/v1.0/articles?feed=42&limit=1", auth=("your-email", "your-password"))
+ >>> print json.loads(r.content)["result"][0]["title"]
+ Sortie de pyAggr3g470r 5.3
+ >>>
Donation
========
bgstack15