google-news-json
Advanced tools
Comparing version 2.0.0 to 2.0.1
@@ -14,10 +14,10 @@ const GEO = "geo"; | ||
Topics.prototype.WORLD = "WORLD"; | ||
Topics.prototype.NATION = "NATION"; | ||
Topics.prototype.BUSINESS = "BUSINESS"; | ||
Topics.prototype.TECHNOLOGY = "TECHNOLOGY"; | ||
Topics.prototype.ENTERTAINMENT = "ENTERTAINMENT"; | ||
Topics.prototype.SCIENCE = "SCIENCE"; | ||
Topics.prototype.SCIENCE = "SPORTS"; | ||
Topics.prototype.SCIENCE = "HEALTH"; | ||
const TOPICS_WORLD = "WORLD"; | ||
const TOPICS_NATION = "NATION"; | ||
const TOPICS_BUSINESS = "BUSINESS"; | ||
const TOPICS_TECHNOLOGY = "TECHNOLOGY"; | ||
const TOPICS_ENTERTAINMENT = "ENTERTAINMENT"; | ||
const TOPICS_SCIENCE = "SCIENCE"; | ||
const TOPICS_SPORTS = "SPORTS"; | ||
const TOPICS_HEALTH = "HEALTH"; | ||
@@ -121,3 +121,2 @@ const _generateGoogleFeedURL = function(method, query, locale){ | ||
// noinspection JSUnresolvedFunction,NodeJsCodingAssistanceForCoreModules | ||
let xml2js = require('xml2js'); | ||
@@ -131,2 +130,5 @@ xml2js.parseString(data, function (err, result) { | ||
let rss = _parseArr(result['rss']['channel']); | ||
rss.items = Object.assign({}, rss.item); | ||
delete rss.item; | ||
if(typeof callback === "function") callback(err, rss); | ||
@@ -136,15 +138,14 @@ resolve(rss); | ||
}); | ||
// // noinspection JSUnresolvedFunction,NodeJsCodingAssistanceForCoreModules | ||
// let http = require('https'); | ||
// | ||
// // noinspection JSUnresolvedFunction | ||
// const feed2json = require('feed2json'); | ||
// feed2json.fromStream(http.get(feedUrl), feedUrl, (err, rss) => { | ||
// if(typeof callback === "function") callback(err, rss); | ||
// err ? reject(err) : resolve(rss); | ||
// }); | ||
}); | ||
}; | ||
module.exports = { HIGHLIGHTS, TOP_NEWS, LOCATION, SEARCH, TOPIC, GEO, getNews, Topics }; | ||
module.exports = { HIGHLIGHTS, TOP_NEWS, LOCATION, SEARCH, TOPIC, GEO, getNews, Topics, | ||
TOPICS_WORLD, | ||
TOPICS_NATION, | ||
TOPICS_BUSINESS, | ||
TOPICS_TECHNOLOGY, | ||
TOPICS_ENTERTAINMENT, | ||
TOPICS_SCIENCE, | ||
TOPICS_SPORTS, | ||
TOPICS_HEALTH | ||
}; |
{ | ||
"name": "google-news-json", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "Simple to use google news api", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
130
7967