Socket
Socket
Sign inDemoInstall

find-rss

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

find-rss - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

28

lib/find-rss.js
// Generated by CoffeeScript 1.6.3
module.exports = function(req, callback) {
var async, candidates, htmlparser, parser, request, url;
var async, candidates, htmlparser, parser, request, sitename, sitenameFlag, url;
htmlparser = require("htmlparser2");
async = require('async');
url = require('url');
request = require('request');
candidates = [];
sitename = '';
sitenameFlag = false;
parser = new htmlparser.Parser({
onopentag: function(name, attr) {
if (name === "link" && attr.type === "application/rss+xml" || attr.type === "application/atom+xml") {
return candidates.push(attr);
candidates.push(attr);
}
if (name === "title") {
return sitenameFlag = true;
}
},
ontext: function(text) {
if (sitenameFlag) {
return sitename = text;
}
},
onclosetag: function(name) {
if (name === "title") {
return sitenameFlag = false;
}
}
});
async = require('async');
url = require('url');
request = require('request');
candidates = [];
return request(req, function(err, res, body) {

@@ -26,2 +41,3 @@ var obj;

return async.forEach(candidates, function(cand, cb) {
cand.sitename = sitename;
if (cand.href.match(/[http|https]:\/\//)) {

@@ -28,0 +44,0 @@ cand.url = cand.href;

{
"name": "find-rss",
"description": "find rss feeds",
"version": "1.0.1",
"version": "1.0.2",
"author": "nikezono",

@@ -16,2 +16,4 @@ "dependencies": {

"rss",
"atom",
"find",
"feed"

@@ -18,0 +20,0 @@ ],

@@ -26,3 +26,4 @@ node-find-rss [![Build Status](https://travis-ci.org/nikezono/node-find-rss.png)](https://travis-ci.org/nikezono/node-find-rss)

# =>
# [ { rel: 'alternate',
# [ { sitename: 'Apple'
rel: 'alternate',
type: 'application/rss+xml',

@@ -29,0 +30,0 @@ title: 'RSS',

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc