Giter Site home page Giter Site logo

Timeout Error Error: ESOCKETTIMEDOUT parsing https://www.nasdaq.com/feed/rssoutbound?category=Stocks about feedparser-promised HOT 5 CLOSED

MichaelWhite63 avatar MichaelWhite63 commented on May 30, 2024
Timeout Error Error: ESOCKETTIMEDOUT parsing https://www.nasdaq.com/feed/rssoutbound?category=Stocks

from feedparser-promised.

Comments (5)

alabeduarte avatar alabeduarte commented on May 30, 2024

Hi @MichaelWhite63

Thank you for raising an issue. I tried the example you provided and I also got the same issue although the XML feed is available if I request it in the browser. This library - feedparser-promised - is a wrapper for https://github.com/danmactough/node-feedparser and here are the things I just tried, without much success:

Bumping node-feedparser to latest version 🔴

I bumped https://github.com/danmactough/node-feedparser to the latest version (v2.2.10) and ran the smoke tests (yarn smoke) with the URL you provided and also got a timeout.

Trying out node-feedparser directly 🔴

I tried to use the https://github.com/danmactough/node-feedparser directly using the examples provided in their README and I also got a timeout.

Here's what I tried:

Go to https://npm.runkit.com/feedparser and put the following (same code as the README):

var FeedParser = require("feedparser")
var fetch = require('node-fetch'); // for fetching the feed

var req = fetch("https://www.nasdaq.com/feed/rssoutbound?category=Stocks")
var feedparser = new FeedParser();

req.then(function (res) {
  if (res.status !== 200) {
    throw new Error('Bad status code');
  }
  else {
    // The response `body` -- res.body -- is a stream
    res.body.pipe(feedparser);
  }
}, function (err) {
  // handle any request errors
});

feedparser.on('error', function (error) {
  // always handle errors
});

feedparser.on('readable', function () {
  // This is where the action is!
  var stream = this; // `this` is `feedparser`, which is a stream
  var meta = this.meta; // **NOTE** the "meta" is always available in the context of the feedparser instance
  var item;

  while (item = stream.read()) {
    console.log(">>>>>>>>>>>>", item);
  }
});

I'm sorry for not come up with the fix for that right away, I'd assume it will require more investigation in the weeds of https://github.com/danmactough/node-feedparser since this library (https://github.com/alabeduarte/feedparser-promised) is just a wrapper, so I would suggest creating an issue there (https://github.com/danmactough/node-feedparser/issues) and see how that goes. If it is something with the library feel free to bump with the new version or even use them directly!

Cheers

from feedparser-promised.

MichaelWhite63 avatar MichaelWhite63 commented on May 30, 2024

from feedparser-promised.

alabeduarte avatar alabeduarte commented on May 30, 2024

Hi @MichaelWhite63

I'd assume that curl would fall into the same category as "programmatic". If they really block it I'm afraid it could be the case they are not open the RSS to use, hard to say. About different ways you can approach, I'd have a look at the "options" here:

Maybe there is an HTTP option you can pass in via request, more info here: https://github.com/alabeduarte/feedparser-promised#using-feedparser-options

Sorry not able to provide more info, let me know what you come up with!

Cheers

from feedparser-promised.

MichaelWhite63 avatar MichaelWhite63 commented on May 30, 2024

from feedparser-promised.

alabeduarte avatar alabeduarte commented on May 30, 2024

Hi @MichaelWhite63

I believe the quickest way to achieve that is to "Watch" this repo (throughout GitHub) so that you subscribe to any changes to the repo. Due to the nature of this library – wrapper – though, the tendency is to always get behind the original code so I'm considering deprecating it.

I'm closing the issue but let me know if there's anything outstanding that I can help you with.

from feedparser-promised.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.