Page 1 of 1
Javascript w/o browser
Posted: Mon Feb 02, 2004 11:08 am
by pickle
I think I'm asking the impossible here, but what I need is some way to run javascript without a browser. There is information stored on another corporate server that they freely allow to be accessed through a javascript they circulate. The trouble is that I need to get that information and store it on my server, but without anyone needing to go to a webpage. Can this be done? Thanks.
Posted: Mon Feb 02, 2004 4:18 pm
by Unipus
I think you're asking the wrong questions. First, why can't you use a browser? Second, what format is this data in and why is it being accessed by javascript in the first place?
Posted: Mon Feb 02, 2004 4:31 pm
by pickle
First) I can't use a browser because the information needs to be retrieved automatically, without any user interaction. This is so I can store the information locally and work with it on my end
Second) This data is given to me in a javascript array. Its accessed by Javascript because that is the format the third party delivers the data in. I have no control over how I get the data - it is only available as a Javascript array.
Posted: Mon Feb 02, 2004 5:34 pm
by Weirdan
pickle wrote:Second) This data is given to me in a javascript array. Its accessed by Javascript because that is the format the third party delivers the data in. I have no control over how I get the data - it is only available as a Javascript array.
This data is given to you as javascript source code (text), which then interpreted by your browser.
Can't you get and parse that text using PHP?

Posted: Mon Feb 02, 2004 5:37 pm
by pickle
Ya, that just occurred to me. Do you have any idea how to use PHP to retrieve the contents of a URL and either store it in a file or in a local variable? I'm researching it now, but if you know....... Thanks.
Posted: Mon Feb 02, 2004 5:43 pm
by Weirdan
you can use [php_man]file[/php_man]("
http://somewhere.net/something.html");
Or, if you need to get the results of POST request use [php_man]cURL[/php_man] extension.
Posted: Mon Feb 02, 2004 5:59 pm
by pickle
Thanks for the direction. I used file("URL HERE") like you said.