Parsing from coolmon (config.xml)

G

GT2000

Guest
I've been wanting to get a small page running on IIS with my computer stats, mainly to make sure it's still chugging along while I'm not at home. I found this real nice example (linked below), but do not for the life of me know how to do this, I gave up on web design well over a year ago, and have lost touch with coding for the most part, anyone know of how to do this?

http://sc-66-27-3-161.socal.rr.com/personal/coolmon/coolmon.html
 
Have you checked out info on their site ?

As far as I know, you will need a webserver such as apache to make this work. Someone can correct me if I'm wrong! ;-)

Anyway, this is what I did to make it work:

Created a new folder (coolmon for e.g.)
c:/apache/htdocs/coolmon
Rightclick your coolmon icon in the tray near the clock
Select autosave xml
Browse to your new folder.
Click Save (may as well use coolmon.xml default!)
Leave interval time as default.

Now create a new notepad document and paste in the following (which I modified from the coolmon site). The bits in bold are what I have changed to make it work. I have included two as examples, but you should be able to get the gist:

<html>
<head>
<title>CoolMon and JavaScript</title>
<script language="JavaScript">
function GetNode(dom,xpath){
var node = dom.selectSingleNode(xpath);
var value = node.text;
return value;
}
function UpdateReadings(){
dom = new ActiveXObject("Msxml.DOMDocument");
dom.async = false;
dom.load("http://localhost/coolmon/coolmon.xml");
User_Name.innerHTML = GetNode(dom,"CoolMon/Raw/User_Name");
IP_Addresses.innerHTML = GetNode(dom,"CoolMon/Raw/IP_Addresses");
}
function CoolMon(){
window.setInterval('UpdateReadings()',1000);
}
</script>
</head>
<body onLoad="CoolMon()">

Logged on as <SPAN ID="User_Name" STYLE="position:relative; font-weight: bold;"></span><br>
IP Address <SPAN ID="IP_Addresses" STYLE="position:relative; font-weight: bold;"></span>

</body>
</html>

You can include as much or as little of the raw or formatted text as you want.

Any problems, send a reply and I'll have a look for ya!

A1ehouse
 
Yea, I forgot to mention that I had tried the code on their old site, when I try that code I'll get an error at the time the page tries to refresh itself. I've also been receiving help from the developers off their forums, but they were unable to figure my problem out. They then however gave me a snip of asp code, and it did the trick, I'm just trying to figure out how to work the response.write code to add additional information, here's the code I have right now:

Code:
<% 

   Set FSO = CreateObject("Scripting.FileSystemObject") 
   path = "C:\Inetpub\wwwroot\config.xml" 
   Set file = FSO.GetFile(path) 
   Set XMLFile = file.OpenAsTextStream(1,-2) 
   Set objXML = CreateObject("MSXML.DOMDocument") 
   objXML.loadXML(XMLFile.ReadAll) 


   Uptime = objXML.getElementsByTagName("Uptime")(0).firstChild.nodeValue 
   Temperature_2 = objXML.getElementsByTagName("Temperature_2")(0).firstChild.nodeValue
   response.write "uptime: " & Left(Uptime,Len(Uptime)-9)

%>

I've added a 2nd bit (Temperature_2), but have been unable to get it to display on the page.

Thanks for the response :)

*edit*
Ok, I've had it explained to me how to use the response.write command, and everything is once again good :)
 

Members online

No members online now.

Latest profile posts

Also Hi EP and people. I found this place again while looking through a oooollllllldddd backup. I have filled over 10TB and was looking at my collection of antiques. Any bids on the 500Mhz Win 95 fix?
Any of the SP crew still out there?
Xie wrote on Electronic Punk's profile.
Impressed you have kept this alive this long EP! So many sites have come and gone. :(

Just did some crude math and I apparently joined almost 18yrs ago, how is that possible???
hello peeps... is been some time since i last came here.
Electronic Punk wrote on Sazar's profile.
Rest in peace my friend, been trying to find you and finally did in the worst way imaginable.

Forum statistics

Threads
62,015
Messages
673,494
Members
5,621
Latest member
naeemsafi
Back