Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

collect-feeds

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

collect-feeds - npm Package Compare versions

Comparing version 0.0.5 to 0.0.6

24

lib/find-feed.js

@@ -8,3 +8,3 @@ 'use strict';

const Queue = require('promise-queue');
const queue = new Queue(5, Infinity);
const queue = new Queue(6, Infinity);
const gotOptions = {

@@ -18,16 +18,22 @@ headers: {

function findFeed(url) {
return queue.add(() => Promise.all([feedFinder(url), rssFinder({url, gotOptions})]))
return Promise.all([queue.add(() => feedFinder(url)), queue.add(() => rssFinder({url, gotOptions}))])
.then(result => {
const feedUrl1 = result[0][0] || null;
const res2 = result[1];
const feedUrl2 = res2.feedUrls && res2.feedUrls.length > 0 ? res2.feedUrls[0].url : null;
const feedUrls1 = result[0];
const feedUrls2 = result[1].feedUrls.map(v => v.url);
if (feedUrl1 === feedUrl2) {
return feedUrl2;
if (feedUrls1[0] && feedUrls1[0] === feedUrls2[0]) {
return feedUrls2[0];
}
const feedUrls = unique(filterEmpties([].concat(res2.feedUrls.map(v => v.url), result[0])));
for (let i = 0, len = feedUrls2.length; i < len; i++) {
const feedUrl = feedUrls2[i];
if (feedUrls1.includes(feedUrl)) {
return feedUrl;
}
}
const feedUrls = unique(filterEmpties(feedUrls2.concat(feedUrls1)));
console.warn(`Should check the url '${url}'. \n Found different feed URLs: \n - ${feedUrls.join('\n - ')}`);
return feedUrl2 || feedUrl1;
return feedUrls2[0] || feedUrls1[0] || null;
});

@@ -34,0 +40,0 @@ }

{
"name": "collect-feeds",
"version": "0.0.5",
"version": "0.0.6",
"description": "A CLI for collect feed URLs.",

@@ -18,3 +18,3 @@ "main": "lib/index.js",

"dependencies": {
"feed-finder": "github:dailyrandomphoto/feed-finder#master",
"feed-finder": "github:dailyrandomphoto/feed-finder#b77a900b004ae5c7178593d9aef6525eb1d5eb69",
"fs-extra": "^8.1.0",

@@ -21,0 +21,0 @@ "promise-queue": "^2.2.5",

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