http://whatpulse.org/api/user.php?UserID=223348
This is the original version of the script -> http://pastebin.com/f35b6b778
Then i fiddled a bit with info from this forum and tutorials. I got it to to read the xml file and output something. But i can't seem to refine the output.
Working script till now -> http://pastebin.com/m34521008
Which outputs this -> http://pastebin.com/m53c44d46
But i can't figure out how i can get the output ^^ in to a nice format so i can deliver it to IRC how i want.
And below here is my try in getting something but that only messed up me script and makes it output errors in DCC instead of some nice output..
Code: Select all
package require http
bind pub - !test pulse_get
proc pulse_get {n u h c t} {
set x [::http::geturl http://whatpulse.org/api/user.php?UserID=223348]
foreach line [split [::http::data $x] \n] {
regsub -line {<AccountName>} set $AccountName {} AccountName
regsub -line {<Country>} set $Country {} Country
regsub -line {<DateJoined>} set $DateJoined {} DateJoined
regsub -line {<Homepage>} set $Homepage {} Homepage
regsub -line {<LastPulse>} set $LastPulse {} LastPulse
regsub -line {<Pulses>} set $Pulses {} Pulses
regsub -line {<TotalKeyCount>} set $TotalKeyCount {} TotalKeyCount
regsub -line {<TotalMouseClicks>} set $TotalMouseClicks {} TotalMouseClicks
regsub -line {<AvKeysPerPulse>} set $AvKeysPerPulse {} AvKeysPerPulse
regsub -line {<AvClicksPerPulse>} set $AvClicksPerPulse {} AvClicksPerPulse
regsub -line {<AvKPS>} set $AvKPS {} AvKPS
regsub -line {<AvCPS>} set $AvCPS {} AvCPS
regsub -line {<Rank>} set $Rank {} Rank
regsub -line {<TeamID>} set $TeamID {} TeamID
regsub -line {<TeamName>} set $TeamName {} TeamName
regsub -line {<TeamMembers>} set $TeamMembers {} TeamMembers
regsub -line {<TeamKeys>} set $TeamKeys {} TeamKeys
regsub -line {<TeamClicks>} set $TeamClicks {} TeamClicks
regsub -line {<TeamDescription>} set $TeamDescription {} TeamDescription
regsub -line {<TeamDateFormed>} set $TeamDateFormed {} TeamDateFormed
puthelp "privmsg $c :AccountName"
puthelp "privmsg $c :Country"
puthelp "privmsg $c :DateJoined"
puthelp "privmsg $c :Homepage"
puthelp "privmsg $c :LastPulse"
puthelp "privmsg $c :Pulses"
puthelp "privmsg $c :TotalKeyCount"
puthelp "privmsg $c :TotalMouseClicks"
puthelp "privmsg $c :AvKeysPerPulse"
puthelp "privmsg $c :AvClicksPerPulse"
puthelp "privmsg $c :AvKPS"
puthelp "privmsg $c :AvCPS"
puthelp "privmsg $c :Rank"
puthelp "privmsg $c :TeamID"
puthelp "privmsg $c :TeamName"
puthelp "privmsg $c :TeamMembers"
puthelp "privmsg $c :TeamKeys"
puthelp "privmsg $c :TeamClicks"
puthelp "privmsg $c :TeamDescription"
puthelp "privmsg $c :TeamDateFormed"
}
}
Greetz ]x[