zizi21
asked on
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
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
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.
ASKER
Thanks Dave Baldwin.
I have even tried to save the file locally and it does not work from the code.
I have even tried to save the file locally and it does not work from the code.
What do you get? That demo page says it outputs data in JSON format.
ASKER
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.
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.
ASKER
I get the json object when i test it in command line.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks so much!
You're welcome, glad to help.