aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCédric Bonhomme <cedric@cedricbonhomme.org>2014-07-04 07:59:50 +0200
committerCédric Bonhomme <cedric@cedricbonhomme.org>2014-07-04 07:59:50 +0200
commit796d1259264a7b7a0725a395dcb69778e7e67254 (patch)
tree2b51025f7c25d7e1ba834085f634dd5c32c7fe2a
parentAdd an article with the JSON REST API with default arguments. (diff)
downloadnewspipe-796d1259264a7b7a0725a395dcb69778e7e67254.tar.gz
newspipe-796d1259264a7b7a0725a395dcb69778e7e67254.tar.bz2
newspipe-796d1259264a7b7a0725a395dcb69778e7e67254.zip
Updated README.
-rw-r--r--README.rst19
1 files changed, 10 insertions, 9 deletions
diff --git a/README.rst b/README.rst
index e18a355f..2034b0e0 100644
--- a/README.rst
+++ b/README.rst
@@ -182,8 +182,8 @@ Add an article:
>>> 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':'06/23/2014 11:42 AM'), '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))
+ >>> 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':'06/23/2014 11:42 AM', 'feed_id':'42'}
+ >>> r = requests.post("https://pyaggr3g470r.herokuapp.com/api/v1.0/articles", headers=headers, auth=("your-email", "your-password"), data=json.dumps(payload))
>>> print r.content
{
"message": "ok"
@@ -214,7 +214,7 @@ Delete an article:
{
"message": "ok"
}
- >>> r = requests.delete("hhttps://pyaggr3g470r.herokuapp.com/api/v1.0/articles/84574", auth=("your-email", "your-password"))
+ >>> r = requests.delete("https://pyaggr3g470r.herokuapp.com/api/v1.0/articles/84574", auth=("your-email", "your-password"))
>>> print r.status_code
404
>>> print r.content
@@ -226,17 +226,18 @@ Delete an article:
Feeds
'''''
+Add a feed:
+
+.. code:: python
+
+ >>> payload = {'link': 'http://blog.cedricbonhomme.org/feed'}
+ >>> r = requests.post("https://pyaggr3g470r.herokuapp.com/api/v1.0/feeds", headers=headers, auth=("your-email", "your-password"), data=json.dumps(payload))
+
Delete a feed:
.. code:: python
>>> r = requests.delete("https://pyaggr3g470r.herokuapp.com/api/v1.0/feeds/29", auth=("your-email", "your-password"))
- >>> print r.status_code
- 200
- >>> print r.content
- {
- "message": "ok"
- }
Donation
========
bgstack15