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

rss-combiner-ns

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rss-combiner-ns

Combine multiple RSS feed sources into one (with namespace support)

  • 0.0.16
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

rss-combiner Build Status

Note: this is a fork of https://travis-ci.org/awocallaghan/node-rss-combiner - it is not meant to exist, I just needed to fork it.

Combine multiple RSS feeds into one using node-feedparser and rss.

npm install rss-combiner

Usage

Combine feeds
var RSSCombiner = require('rss-combiner');

// Promise usage
RSSCombiner(feedConfig)
  .then(function (combinedFeed) {
    var xml = combinedFeed.xml();
  });

// Node callback usage
RSSCombiner(feedConfig, function (err, combinedFeed) {
  if (err) {
    console.error(err);
  } else {
    var xml = combinedFeed.xml();
  }
});
Combine feeds and import custom XML namespaces
var RSSCombiner = require('rss-combiner');
var feedConfig = {
  custom_namespaces: {
    'content': 'http://purl.org/rss/1.0/modules/content/',
    'dc': 'http://purl.org/dc/elements/1.1/'
  }
};

// Promise usage
RSSCombiner(feedConfig)
  .then(function (combinedFeed) {
    var xml = combinedFeed.xml();
  });

// Node callback usage
RSSCombiner(feedConfig, function (err, combinedFeed) {
  if (err) {
    console.error(err);
  } else {
    var xml = combinedFeed.xml();
  }
});
Combine feeds and get a callback for each feed fetched.
var RSSCombiner = require('rss-combiner');
var feedConfig = {
  successfulFetchCallback: function(streamInfo) { console.log(streamInfo) }
};

// Promise usage
RSSCombiner(feedConfig)
  .then(function (combinedFeed) {
    var xml = combinedFeed.xml();
  });

// Node callback usage
RSSCombiner(feedConfig, function (err, combinedFeed) {
  if (err) {
    console.error(err);
  } else {
    var xml = combinedFeed.xml();
  }
});
feedOptions

See rss feedOptions

Additional options

  • size int the maximum number of entries to keep (most recently published will be kept)
  • feeds array url string array of feed_urls to retrieve content from
  • softFail optional boolean if true failing to retrieve a single feed will not result in an error being thrown (default value: false)
Example feedOptions

Creates a new feed with a maximum of 20 entries containing the latest entries from 2 RSS feeds.

var feedConfig = {
  title: 'Tech news from Guardian and BBC',
  size: 20,
  feeds: [
    'http://feeds.bbci.co.uk/news/technology/rss.xml',
    'https://www.theguardian.com/uk/technology/rss'
  ],
  pubDate: new Date()
};

Keywords

FAQs

Package last updated on 22 Mar 2020

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