2018-04-24 23:02:31 +03:00
2018-04-22 18:08:15 +03:00
2018-04-22 18:06:02 +03:00
2014-12-19 12:56:24 -05:00
2018-04-24 20:06:05 +03:00
2015-11-11 17:23:41 +00:00
2017-01-11 16:00:53 +00:00
2018-04-24 21:22:03 +03:00
2018-04-24 23:02:31 +03:00

WIP

turbo-rss

Build Status npm Packagist

RSS based, feed generator for Yandex turbo.

WARNING! Work In Progress

Usage

Create a new feed

var TR = require('turbo-rss');

var feed = new TS(feedOptions);
feedOptions
  • title string Title of your site or feed
  • description optional string A short description of the feed.
  • author optional string If included it is the name of the item's creator.
  • link url string Url to the site that the feed is for.
  • pubDate optional Date object or date string The publication date for content in the feed

Add items to a feed

An item can be used for a blog entry, project update, log entry, etc. Your RSS feed can have any number of items. Most feeds use 20 or fewer items.

feed.item(itemOptions);
itemOptions
  • title string Title of this particular item.
  • image_url url string Link to header image
  • url url string Url to the item. This could be a blog entry.
  • author optional string If included it is the name of the item's creator. If not provided the item author will be the same as the feed author. This is typical except on multi-author blogs.
  • date string The date and time of when the item was created. Feed readers use this to determine the sort order. Some readers will also use it to determine
  • content string Content
Feed XML
var xml = feed.xml();

This returns the XML as a string.

maybe later... indent optional boolean or string What to use as a tab. Defaults to no tabs (compressed). For example you can use '\t' for tab character, or ' ' for two-space tabs. If you set it to true it will use four spaces.

Example Usage

var RSS = require('rss');

/* lets create feed */
var feed = new RSS({
    title: 'title',
    description: 'description',
    link: 'http://example.com', // site url
    author: 'LightAir',
    pubDate: 'May 20, 2012 04:00:00 GMT'
});

/* loop over data and add to feed */
feed.item({
    title:  'item title',
    image_url: 'http://example.com/example.png',
    url: 'http://example.com/article4?this&that', // link to the item
    author: 'LightAir', // optional - defaults to feed author property
    date: 'May 27, 2012',
    content: '<p>hello</p>'
});

// cache the xml to send to clients
var xml = feed.xml();

Contributing

Contributions to the project are welcome. Feel free to fork and improve. I do my best accept pull requests in a timely manor, especially when tests and updated docs are included.

Tests

Tests included use Mocha. Use npm test to run the tests.

$ npm test
Description
RSS based, feed generator for Yandex turbo
Readme MIT 315 KiB
Languages
JavaScript 100%