Implementing TTRSS: Subscribe to a Feed #92

Closed
opened 7 years ago by jking · 2 comments
jking commented 7 years ago
Owner

subscribeToFeed (API level 5 - version:1.7.6)

Subscribes to specified feed, returns a status code. See
subscribe_to_feed() in functions.php for details.

Parameters:

  • feed_url - Feed URL (string)
  • category_id - Category id to place feed into (defaults to 0, Uncategorized) (int)
  • login, password - Self explanatory (string)
### subscribeToFeed (API level 5 - version:1.7.6) Subscribes to specified feed, returns a status code. See subscribe\_to\_feed() in functions.php for details. Parameters: * feed\_url - Feed URL (string) * category\_id - Category id to place feed into (defaults to 0, Uncategorized) (int) * login, password - Self explanatory (string)
jking added this to the 0.2.0 milestone 7 years ago
jking added the
feature
api
labels 7 years ago
jking added the
trivial
label 7 years ago
jking removed the
trivial
label 7 years ago
Poster
Owner

The return codes are:

	/**
	 * @return array (code => Status code, message => error message if available)
	 *
	 *                 0 - OK, Feed already exists
	 *                 1 - OK, Feed added
	 *                 2 - Invalid URL
	 *                 3 - URL content is HTML, no feeds available
	 *                 4 - URL content is HTML which contains multiple feeds.
	 *                     Here you should call extractfeedurls in rpc-backend
	 *                     to get all possible feeds.
	 *                 5 - Couldn't download the URL content.
	 *                 6 - Content is an invalid XML.
	 */

Additionally, it -does- also return the added subscription ID for codes 0 or 1.

Because TTRSS returns the existing subscription ID upon duplication, we'll need a backend function to discover a feed URL manually (picoFeed does expose the functionality, though not terribly cleanly), probably as a static method of the Feed class.

The return codes are: ```php /** * @return array (code => Status code, message => error message if available) * * 0 - OK, Feed already exists * 1 - OK, Feed added * 2 - Invalid URL * 3 - URL content is HTML, no feeds available * 4 - URL content is HTML which contains multiple feeds. * Here you should call extractfeedurls in rpc-backend * to get all possible feeds. * 5 - Couldn't download the URL content. * 6 - Content is an invalid XML. */ ``` Additionally, it -does- also return the added subscription ID for codes 0 or 1. Because TTRSS returns the existing subscription ID upon duplication, we'll need a backend function to discover a feed URL manually (picoFeed does expose the functionality, though not terribly cleanly), probably as a static method of the Feed class.
Poster
Owner

Example output:

{"seq":0,"status":0,"content":{"status":{"code":1,"feed_id":8}}}

{"seq":0,"status":0,"content":{"status":{"code":5,"message":"6 Could not resolve host: example"}}}
Example output: ```json {"seq":0,"status":0,"content":{"status":{"code":1,"feed_id":8}}} {"seq":0,"status":0,"content":{"status":{"code":5,"message":"6 Could not resolve host: example"}}} ```
jking closed this issue 7 years ago
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date

0000-12-31

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.