What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Read from XML

Read from XML
Author: Message:
Joakin
New Member
*


Posts: 7
Joined: Apr 2006
O.P. Read from XML
I dont know nothing about that. I am a beginin... So.. Can you help me please??

ok.. this is what i want...

I have to read some ¿variables? from a XML... From this XML archive.
I need to read some variables like TotalKeyCount, TotalMouseClicks, etc.

And then send by menssage like: I have been made "TotalKeyCount" keys.

i dont know what i have to do... please someone help me! *-)

thanks...

(Sorry for my Bad English)

This post was edited on 10-28-2006 at 06:58 PM by Joakin.
10-28-2006 06:57 PM
Profile E-Mail PM Find Quote Report
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
32 / Male / Flag
Joined: Apr 2004
RE: Read from XML
You can use the Microsoft XML object for this. :)
code:
var xml = new ActiveXObject('Microsoft.XMLDOM'); //Create the ActiveX object
xml.load("http://whatpulse.org/api/users/171247.xml"); //Load the XML file
var totalKeyCount = xml.selectNodes("/UserStats/TotalKeyCount/text()"); //Get the text from the node
var message = "I have made "+totalKeyCount+" key strokes."; //Create a message
ChatWnd.SendMessage(message); //Send the message --- Make sure ChatWnd is defined!!!
Normally, it should work perfectly. ;)
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
10-28-2006 07:13 PM
Profile E-Mail PM Web Find Quote Report
Joakin
New Member
*


Posts: 7
Joined: Apr 2006
O.P. RE: Read from XML
Thank you so much!
What i have to do to define the ChatWnd xD :S
10-28-2006 07:32 PM
Profile E-Mail PM Find Quote Report
Felu
Veteran Member
*****


Posts: 2223
Reputation: 72
30 / Male / Flag
Joined: Apr 2006
Status: Away
RE: RE: Read from XML
quote:
Originally posted by Joakin
What i have to do to define the ChatWnd xD :S

The ChatWnd is the Window with a contact to whom you want to send the message to. To use the ChatWnd the ChatWnd should already be created or you'll have to create a chatwnd.
10-28-2006 07:45 PM
Profile E-Mail PM Web Find Quote Report
Joakin
New Member
*


Posts: 7
Joined: Apr 2006
O.P. RE: Read from XML
Testing the code i write this:

code:
function wp(ChatWnd){
var xml = new ActiveXObject('Microsoft.XMLDOM');

//Create the ActiveX object
xml.load("http://whatpulse.org/api/users/171247.xml");
//Load the XML file
var totalKeyCount = xml.selectNodes("/UserStats/TotalKeyCount/text()");
//Get the text from the node
var message = "I have made "+totalKeyCount+" key strokes.";
//Create a message
ChatWnd.SendMessage(message);
//Send the message --- Make sure ChatWnd is defined!!!
}


And i write in my first chat window: /script wp 1

but the menssage is:   Joakin dice (16:42):
I have made  key strokes.

it doesnt show the numbers.
:(
10-28-2006 07:48 PM
Profile E-Mail PM Find Quote Report
Spunky
Former Super Mod
*****

Avatar

Posts: 3658
Reputation: 61
36 / Male / Flag
Joined: Aug 2006
RE: Read from XML
The xml in the first link has an error (reported error anyways) and so can't be read. Try fixing your xml file and then trying again
<Eljay> "Problems encountered: shit blew up" :zippy:
10-28-2006 09:38 PM
Profile PM Find Quote Report
Joakin
New Member
*


Posts: 7
Joined: Apr 2006
O.P. RE: Read from XML
the error is that the xml dont have style. but it is not necesary. I think. Becouse it used in mane others script in php or IRC script. And I cant modified the XML.
10-28-2006 09:51 PM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On