Parsing from coolmon (config.xml)

G

GT2000

Guest
#1
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
 

a1ehouse

Chamone M*tha Fu*ka
Joined
May 21, 2002
Messages
288
#2
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
 
G

GT2000

Guest
#3
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 posts

Latest profile posts

Perris Calderon wrote on Electronic Punk's profile.
Ep, glad to see you come back and tidy up...did want to ask a one day favor, I want to enhance my resume , was hoping you could make me administrator for a day, if so, take me right off since I won't be here to do anything, and don't know the slightest about the board, but it would be nice putting "served administrator osnn", if can do, THANKS

Been running around Quora lately, luv it there https://tinyurl.com/ycpxl
Electronic Punk wrote on Perris Calderon's profile.
All good still mate?
Hello, is there anybody in there? Just nod if you can hear me ...
Xie
What a long strange trip it's been. =)

Forum statistics

Threads
62,010
Messages
673,478
Members
89,034
Latest member
whiteada64