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?
 
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
 
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
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
Dave BaldwinFixer of ProblemsCommented:
What do you get?  That demo page says it outputs data in JSON format.
0
 
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
 
zizi21Author Commented:
Thanks so much!
0
 
Dave BaldwinFixer of ProblemsCommented:
You're welcome, glad to help.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.