Skip to content
Guido Krömer edited this page Feb 4, 2014 · 2 revisions

Managing feeds

GET api/1/feed

Get all feeds

Example response

{
   "status":200,
   "response":[
      {
         "title":    "9GAG feed",
         "url":      "http:\/\/9gagrss.com\/feed",
         "updated":  1390861914,
         "interval": 1800,
         "total":    500,
         "unread":   471,
         "outdated": 0,
         "id":       72
      },
      {
         "title":    "Cacomania",
         "url":      "http:\/\/cacodaemon.de\/index.php?atom=1",
         "updated":  1390849843,
         "interval": 14400,
         "total":    13,
         "unread":   0,
         "outdated": 0,
         "id":       1
      }
   ]
}

POST api/1/feed

Add a feed

Example request

{
  "url": "https:\/\/blogs.apache.org\/couchdb\/feed\/entries\/atom?cat=%2FRelease"
}

Example response

{
  "status": 201,
  "response": 73 /*Id of newly added bookmark*/
}

GET api/1/feed/:id

Get a feed by its id

Example request api/1/feed/1

Example response

{
   "status":200,
   "response":{
      "title":    "Cacomania",
      "url":      "http:\/\/cacodaemon.de\/index.php?atom=1",
      "updated":  1390849843,
      "interval": 14400,
      "total":    13,
      "unread":   0,
      "outdated": 0,
      "id":       1
   }
}

PUT api/1/feed/:id

Edit a feed specified by its id

Example request api/1/feed/72

{
  "title": "9GAG"
}

Example response

{
  "status": 200,
  "response": 72
}

DELETE api/1/feed/:id

Delete a feed specified by its id

Example request api/1/feed/72

Example response

{
  "status": 200,
  "response": 72
}

#Reading feeds

GET api/1/feed/item

Get all feed item headings and meta data

Example request api/1/feed/item

Example response

{
   "status":200,
   "response":[
      {
         "uuid":   "tag:cacodaemon.de,2013-02-19:790f1dccea4a63e35c0f233a76af29ff\/8ae9a8a6a6477e5b852f379897afd85a",
         "id_feed": 1,
         "title":   "A simple RESTful AngularJS bookmark app",
         "author":  null,
         "content": null,
         "url":     "http:\/\/cacodaemon.de\/index.php?id=44",
         "date":    1367864820,
         "read":    1,
         "id":      1
      },
      {
         "uuid":    "http:\/\/us1.campaign-archive.com\/?u=0618f6a79d6bb9675f313ceb2&id=8a065d39eb",
         "id_feed": 11,
         "title":   "This Week's JavaScript News – Issue 128",
         "author":  null,
         "content": null,
         "url":"    http:\/\/us1.campaign-archive.com\/?u=0618f6a79d6bb9675f313ceb2&id=8a065d39eb",
         "date":    1367568720,
         "read":    1,
         "id":      333
      }
   ]
}

GET api/1/feed/:id_feed/item

Get all feed item headings and meta data by a specific feed

Example request api/1/feed/1/item

Example response

{
   "status":200,
   "response":[
      {
         "uuid":null,
         "id_feed":1,
         "title":"Simple AngularJS sum by key view filter",
         "author":"Guido Kr\u00f6mer",
         "content":null,
         "url":"http:\/\/cacodaemon.de\/index.php?id=55",
         "date":1385932800,
         "read":1,
         "id":55518
      },
      {
         "uuid":null,
         "id_feed":1,
         "title":"Unix timestamp conversion with date",
         "author":"Guido Kr\u00f6mer",
         "content":null,
         "url":"http:\/\/cacodaemon.de\/index.php?id=56",
         "date":1386705780,
         "read":1,
         "id":58676
      },
      {
         "uuid":null,
         "id_feed":1,
         "title":"Using nested views in AngularJS with UI-Router",
         "author":"Guido Kr\u00f6mer",
         "content":null,
         "url":"http:\/\/cacodaemon.de\/index.php?id=57",
         "date":1390065480,
         "read":1,
         "id":70804
      }
   ]
}

GET api/1/feed/item/:id

Get one feed item by its id

Example request api/1/feed/item/1

Example response

{
   "status":200,
   "response":{
      "uuid":    "tag:cacodaemon.de,2013-02-19:790f1dccea4a63e35c0f233a76af29ff\/8ae9a8a6a6477e5b852f379897afd85a",
      "id_feed": 1,
      "title":   "A simple RESTful AngularJS bookmark app",
      "author":  null,
      "content": "Many many text...",
      "url":     "http:\/\/cacodaemon.de\/index.php?id=44",
      "date":    1367864820,
      "read":    1,
      "id":      1
   }
}

DELTE api/1/feed/item/:id

Remove one feed item by its id

Example request api/1/feed/item/1

Example response

{
   "status":   200,
   "response": 1
}

GET api/1/feed/calculate-update-interval

Calculates an optimal update interval for each feed.

POST api/1/feed/item/queue/:id

Enqueue a feed item. The feed item queue is a kind of "Pick items for later reading".

Example request api/1/feed/item/1

Example response

{
   "status":   201,
   "response": 1
}

Get api/1/feed/item/queue

Dequeue a feed item.

Example request api/1/feed/item

Example response

{
   "status":   200,
   "response":{
      "uuid":    "tag:cacodaemon.de,2013-02-19:790f1dccea4a63e35c0f233a76af29ff\/8ae9a8a6a6477e5b852f379897afd85a",
      "id_feed": 1,
      "title":   "A simple RESTful AngularJS bookmark app",
      "author":  null,
      "content": "Many many text...",
      "url":     "http:\/\/cacodaemon.de\/index.php?id=44",
      "date":    1367864820,
      "read":    1,
      "id":      1
   }
}