Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

turbo-rss

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

turbo-rss

RSS based, feed generator for Yandex turbo

  • 1.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
170
increased by40.5%
Maintainers
1
Weekly downloads
 
Created
Source

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

Keywords

FAQs

Package last updated on 24 Apr 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc