Create URL in javascript node js

Hi All,

I have the following url:

        var url = "http://test/global.html";
This url will then be sent to the unfluff module like this:
     
      var data = unfluff(url,'en');

It appears that unfluff can't seem to detect the url . Thought maybe, it is the way, I constructed the url. Is there a module to create a url to pass it to the unfluff module instead of just using string.

Thanks a lot
zizi21Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Dave BaldwinFixer of ProblemsCommented:
It appears that 'unfluff' is expecting a file or local variable, not a URL.  The demo code on this page https://github.com/ageitgey/node-unfluff uses cURL to get the content of URLs.
0
zizi21Author Commented:
Thanks Dave Baldwin.

I have even tried to save the file locally and it does not work from the code.
0
Dave BaldwinFixer of ProblemsCommented:
What do you get?  That demo page says it outputs data in JSON format.
0
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

zizi21Author Commented:
In the command line, I have tried unfluff test.html and it works  where test.html is stored locally.

But, in the code, it does not work. Could it be that test.html needs to be written in a url understood by node js javascript.
0
zizi21Author Commented:
I get the json object when i test it in command line.
0
Dave BaldwinFixer of ProblemsCommented:
I believe you have it exactly right.  According to the demo code, 'unfluff' does not understand URLs.  You have to get the data by some other method and store it locally for 'unfluff' to do anything with it.  I can't find any good examples for you to look at.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
zizi21Author Commented:
Thanks so much!
0
Dave BaldwinFixer of ProblemsCommented:
You're welcome, glad to help.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.