Socket
Socket
Sign inDemoInstall

amphora-rss

Package Overview
Dependencies
49
Maintainers
5
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    amphora-rss

Convert JSON from Amphora into RSS


Version published
Weekly downloads
77
decreased by-18.09%
Maintainers
5
Created
Weekly downloads
 

Readme

Source

Amphora RSS

CircleCI Coverage Status

Notice

This is a pre-1.x version of the renderer and the API is subject to change. It's recommended to install a specific version of the package until a stable API is reached.

Install

$ npm install --save amphora-rss

Use Case

The primary use case for this renderer is when you want to use component instances to generate RSS feeds. Using this renderer, you can turn feeds into components that can be edited through the Kiln interface to effectively move feed generation to component configuration.

How To

This renderer is highly dependent on the component API provided by Amphora and therefore relies on a component that can generate a feed of documents to be passed off to the renderer. Here's an example implementation

  • An rss-feed component stores within itself the logic to query some service that generates feeds and stores the results within its own instance data.
  • Using the renderer specific model.js file the data of the component is trimmed down into an object with two specific properties:
    • feed: an Array of objects (read below for structure specification)
    • meta: an Object with properties that will be used in generating RSS meta tags at the top of the feed
  • The data is passed to this render which turns feed data into an RSS document

Data Specification

feed Array

At it's core, this renderer is a wrapper around the xml package to build the XML for the feed. This means that it is the responsibility of the renderer specific model.js file to create a feed object that abides by the API of this package. Refer to the package README for structure of this array.

Meta

The meta object is a very simple object composed of few properties which are used in composition of the XML.

  • title: a string rendered in the <title> tag of the XML document
  • description: a string rendered in the <description> tag of the XML document
  • link: a string rendered in the <link> tag of the XML document
  • copyright (optional): a string or number rendered in the <copyright> tag of the XML document. If not provided, the current year will be used.
  • generator (optional): a string rendered in the <generator> tag of the XML document. Defaults to Feed delivered by Clay.
  • docs: a string rendered in the <docs> tag of the XML document. Defaults to http://blogs.law.harvard.edu/tech/rss.

FAQs

Last updated on 23 Apr 2018

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc