Socket
Socket
Sign inDemoInstall

google-news-rss

Package Overview
Dependencies
47
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.2.0 to 0.2.1

26

index.js

@@ -31,5 +31,26 @@ const assert = require('assert');

const deriveDescription = rawDescription => {
if (!rawDescription) {
return 'No description found';
}
const match = rawDescription.match(/size="-1">(?!<b>).+\.\.\./g);
if (match) {
const description = match[0];
// decode -> striptags -> substr
const formatDescription = decode(striptags(description.substr(10, description.length)));
// Odd character that appears, will remove manually
const removedStaryChars = formatDescription.replace(/—/g, '');
return removedStaryChars;
}
// Shouldn't get passed here, if so that means there have been google updates
// Put will remove as much of noise as possible
return decode(striptags(rawDescription));
};
const formatArticle = article => {
const description = article.description;
const $ = cheerio.load(description);
const cleanDescription = deriveDescription(description);

@@ -43,7 +64,2 @@ // Remove the appended "- Publisher"

// Remove excess information in description
$('font b').remove();
const htmlDescription = $.html();
const cleanDescription = decode(striptags(htmlDescription));
// Add publisher, re-formatted description, and url

@@ -50,0 +66,0 @@ const formatArticle = Object.assign(article, {

2

package.json
{
"name": "google-news-rss",
"version": "0.2.0",
"version": "0.2.1",
"description": "A node module that searches Google News RSS Feed and returns a usable JSON response",

@@ -5,0 +5,0 @@ "license": "MIT",

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