Javascript w/o browser

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Javascript w/o browser

Post 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.
Unipus
Forum Contributor
Posts: 409
Joined: Tue Aug 26, 2003 2:06 pm
Location: Los Angeles, CA

Post 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?
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Post 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.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post 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? ;)
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Post 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.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post 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.
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Post by pickle »

Thanks for the direction. I used file("URL HERE") like you said.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Post Reply