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
/**
* @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.
{"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"}}}
```
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:
The return codes are:
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.
Example output: