0.0.5 • Published 1 year ago

ttrss-js-api2 v0.0.5

Weekly downloads
-
License
BSD-2-Clause
Repository
github
Last release
1 year ago

TTRSS-JS-API

This package is a primitive JavaScript/TypeScript implementation of a subset of the TinyTinyRSS API.

You can use it to retrieve categories, feeds, headlines and articles from a TinyTiny RSS instance.

Installation

npm install ttrss-js-api

Usage

The API is exposed through the API interface.

To build an API instance, use the API Factory:

const ApiFactory = require('ttrss-js-api').ApiFactory;
const api = ApiFactory.build('http://my-ttrs-instance.com');

You can now login to your TinyTiny RSS instance and retrieve categories, feeds, headlines and articles:

(async () => {
    await api.login('username', 'password');
    const categories = await api.getCategories();
    const feeds = await api.getFeeds({categoryId: categories[0].id});
    const headlines = await api.getHeadlines({feedId: feeds[1].id});
    const article = await api.getArticle(headlines[0].id);
    console.log(article.content);
    await api.logout();
})();

Detail on each entity is available in the API documentation:

0.0.5

1 year ago