Synopsis
Used by FortunesRocks.me LLC for news monitoring
Code Example
//
// ==> Create a DrudgeReport object
//
var dr = new DrudgeReport();
//
// ==> Create a callback function. DR will call this each time it has new
// ==> articles, once you pass it to DR.
//
var myStream = (articles:DrudgeArticle[]) => {
console.log("Got a new set of articles",articles.length);
processStream(articles);
}
dr.stream(myStream);
//
// ==> done!
//
Motivation
DrudgeReport is one of the most infulential news based websites in the world. Monirtoring the feed is crtical to news senstive markets.
Installation
npm install --save drudgereport
API Reference
To set the loglevel to debug..
dr.setLogLevel("info"); [debug,info,warn,error] are all legit values;
To set poll rate (default if 15 minutes);
dr.setPollInterval = 15 * 60; (this is 15 minutes, value is seconds)
//
// ==> Object model
//
export class DrudgeArticle {
html: string;
time: Date;
location: string;
index: number;
source: string;
href: string;
latest: Date;
}
Tests
There is a testDrudge.ts/js included in the package to test the function.
Contributors
FortunesRocks.me LLC contact me there if you have questions;
npms + "the little a rolled in a blanket"+fortunesrocks.me
License
ISC