Skip to content
Permalink
Branch: master
Find file Copy path
1 contributor

Users who have contributed to this file

21 lines (18 sloc) 760 Bytes
const utils = require ("daveutils");
const feedRead = require ("davefeedread");
const urlTestFeed = "http://rss.nytimes.com/services/xml/rss/nyt/Technology.xml";
const timeOutSecs = 30;
const whenstart = new Date ();
feedRead.parseUrl (urlTestFeed, timeOutSecs, function (err, theFeed) {
if (err) {
console.log (err.message);
}
else {
console.log ("It took " + utils.secondsSince (whenstart) + " seconds to read and parse the feed.");
console.log ("theFeed.head == " + utils.jsonStringify (theFeed.head));
console.log ("theFeed.items [0] == " + utils.jsonStringify (theFeed.items [0]));
for (var i = 0; i < theFeed.items.length; i++) {
console.log ("Item #" + utils.padWithZeros (i, 2) + ": " + theFeed.items [i].title + ".");
}
}
});
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.