Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Detecting Data Change in JS

 
Adam Nottingham
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My current project is something to track print usage. After logging into the printer's web interface and looking at the logs I realized that it was a rolling log with a fixed number or rows. Therefore, once it is full the bottom element falls off and one is added to the top something like a queue. While looking at the source for the page however, I noticed that the actual data was store in the JScript source instead of being recorded. I have made the line I'm talking about bold down below.

Basically what I want to do is, as soon as the online log is updated I want to be able to pull that info from the page and save it to another file on my hard drive. How can I go about automating this so that it will watch the page and automatically pull the information?

I have added the part of the .html containing the appropriate script.

Thanks





 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65111
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please UseCodeTags.
 
Adam Nottingham
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ah I apologize. Thanks.

The applicable line that was in bold is now on line 28.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why don't you just use a client application to fetch the url and read the file? Simple reg exp can grab it, rip it apart, and you can save it.

Seems pretty weird you do not have a log on the server you can tail in the first place.

Eric

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic