Nocturnal Pumpkin Maelstrom
Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

statuspage.io-listener

1.0.0 • Public • Published

statuspage.io-listener

Discord David NPM version NPM downloads GitHub Issues GitHub Last Commit License

Installation

$ npm i --save statuspage.io-listener
const StatusPage = require("statuspage.io-listener")
 
// url, readFunction, writeFunction, { interval: 10000 }
// functions can also have async if wanted
let listener = new StatusPage.Listener("https://metastatuspage.com/history.rss", readFunction, writeFunction)
 
listener.on('ready', () => { console.log("Ready!") })
listener.on('error', error => { console.error(error) })
listener.on('newItem', item => { console.log(item) })
 
// Example Read & Write Functions
const fs = require("fs")
 
function readFunction() {
    return fs.readFileSync("./pubDate.txt", "utf8")
}
 
function writeFunction(pubDate) {
    fs.writeFileSync("./pubDate.txt", pubDate, "utf8")
}

Item Example

{ title: 'Postmortem editing unavailable for some customers',
  description: 'On further investigation this issue turned out to be isolated to embedding images in postmortems. We’re closing this incident and will instead be sending this through our usual lower priority bug flow. Please reach out to support if you run into any issues.',
  pubDate: 'Fri, 14 Dec 2018 12:43:46 -0800',
  link: 'https://metastatuspage.com/incidents/mybtvbp3fjby',
  guid: 'https://metastatuspage.com/incidents/mybtvbp3fjby',
  type: 'Resolved' }

Install

npm i statuspage.io-listener

DownloadsWeekly Downloads

3

Version

1.0.0

License

MIT

Unpacked Size

7.54 kB

Total Files

5

Last publish

Collaborators

  • avatar