By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,833 Members | 1,188 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,833 IT Pros & Developers. It's quick & easy.

Javascript to capture HTTP data for parsing

P: n/a
I am trying to write a script which will allow me to read the contents of an
HTTP web page into memory, parse the data, and output a calculated value.

The HTTP page is on a web enable appliance - I am reading some data out of a
table for further calculation. I can't modify the web appliance, only read
the text data.

I've written a script on my Windoze PC that successful uses a MSXML2 ActiveX
object to read the contents of a web page into memory using the
xmlhttp.responseText object. The problem is that the ActiveX object is not
available on a lightweight Linux based http server.

I need to write a script that will work with ASP/Javascript on a lightweight
Linux based http server.

Anybody have any recommendations?
Feb 18 '07 #1
Share this Question
Share on Google+
4 Replies

P: n/a
VK
On Feb 18, 7:15 pm, "Epictitus" <mikeNOSPAMster...@gmail.comwrote:
I am trying to write a script which will allow me to read the contents of an
HTTP web page into memory, parse the data, and output a calculated value.

The HTTP page is on a web enable appliance - I am reading some data out of a
table for further calculation. I can't modify the web appliance, only read
the text data.

I've written a script on my Windoze PC that successful uses a MSXML2 ActiveX
object to read the contents of a web page into memory using the
xmlhttp.responseText object. The problem is that the ActiveX object is not
available on a lightweight Linux based http server.

I need to write a script that will work with ASP/Javascript on a lightweight
Linux based http server.
I am a bit confused: where is that "lightweight Linux based http
server"? You mean that "web enable appliance" is running under that
server and you need to read data from it into some conventional
browser? Or you mean that some client is running under "lightweight
Linux based http server" and she need to read data from your appliance?

Feb 18 '07 #2

P: n/a
web based appliance = industrial modem (data server)
* I can access the modem via a web interface to view communications data
* the data posted by the modem needs to be used for some calculations and
formatting

lightweight linux http server = router (client/server)
* I have a router I can program custom javascript and asp scripts
* I want to make a web page that summarizes data from the modem and other
devices

"VK" <sc**********@yahoo.comwrote in message
news:11********************@v45g2000cwv.googlegrou ps.com...
On Feb 18, 7:15 pm, "Epictitus" <mikeNOSPAMster...@gmail.comwrote:
>I am trying to write a script which will allow me to read the contents of
an
HTTP web page into memory, parse the data, and output a calculated value.

The HTTP page is on a web enable appliance - I am reading some data out
of a
table for further calculation. I can't modify the web appliance, only
read
the text data.

I've written a script on my Windoze PC that successful uses a MSXML2
ActiveX
object to read the contents of a web page into memory using the
xmlhttp.responseText object. The problem is that the ActiveX object is
not
available on a lightweight Linux based http server.

I need to write a script that will work with ASP/Javascript on a
lightweight
Linux based http server.

I am a bit confused: where is that "lightweight Linux based http
server"? You mean that "web enable appliance" is running under that
server and you need to read data from it into some conventional
browser? Or you mean that some client is running under "lightweight
Linux based http server" and she need to read data from your appliance?

Feb 18 '07 #3

P: n/a
VK
On Feb 18, 11:53 pm, "Epictitus" <mikeNOSPAMster...@gmail.comwrote:
web based appliance = industrial modem (data server)
* I can access the modem via a web interface to view communications data
* the data posted by the modem needs to be used for some calculations and
formatting

lightweight linux http server = router (client/server)
* I have a router I can program custom javascript and asp scripts
* I want to make a web page that summarizes data from the modem and other
devices
Unless I'm still missing the picture the only problem is to be able to
make GET request to your modem: directly or over the router's layer.

After all the data is retrieved for a fat client (full-scaled UA) so
all logic can be moved onto the client:

UA (browser) with ajaxoid and DOM scripting
| |
GET request for text/plain, text/xml or text/html
| |
router
| |
web-enabled device

So within your current network are you able to put such requests? If
yes than your router capabilities are irrelevant for the task, let's
talk about client-side scripting.

If you want to use your router as an intermediary server (a la "star"
network) like

device device
| |
router ... multiple HTTP clients
| |
device device

then really javascript has nothing to do with it. Theoretically you
may install some whitebeam-like engine for server-side javascript on
your router (??) but practically just make a conventional server-side
solution.

Feb 18 '07 #4

P: n/a
Thanks VK. What I'm trying to do is called "scraping". I've found a lot of
"packages" which could be installed but I'm looking for a lightweight,
simple solution.

My problem is that my router is limited in memory, available apps etc. and I
don't have Perl/Ajax installed. I do have Javascript (server and client
side) and asp.


"VK" <sc**********@yahoo.comwrote in message
news:11*********************@p10g2000cwp.googlegro ups.com...
On Feb 18, 11:53 pm, "Epictitus" <mikeNOSPAMster...@gmail.comwrote:
>web based appliance = industrial modem (data server)
* I can access the modem via a web interface to view communications data
* the data posted by the modem needs to be used for some calculations and
formatting

lightweight linux http server = router (client/server)
* I have a router I can program custom javascript and asp scripts
* I want to make a web page that summarizes data from the modem and other
devices

Unless I'm still missing the picture the only problem is to be able to
make GET request to your modem: directly or over the router's layer.

After all the data is retrieved for a fat client (full-scaled UA) so
all logic can be moved onto the client:

UA (browser) with ajaxoid and DOM scripting
| |
GET request for text/plain, text/xml or text/html
| |
router
| |
web-enabled device

So within your current network are you able to put such requests? If
yes than your router capabilities are irrelevant for the task, let's
talk about client-side scripting.

If you want to use your router as an intermediary server (a la "star"
network) like

device device
| |
router ... multiple HTTP clients
| |
device device

then really javascript has nothing to do with it. Theoretically you
may install some whitebeam-like engine for server-side javascript on
your router (??) but practically just make a conventional server-side
solution.

Feb 19 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.