herald/nb_connected2.xml HTTP/1.1
comes back with
HTTP/1.1 200 OK
Age: 0
Date: Fri, 25 Mar 2005 22:47:03 GMT
Content-Length: 959
Content-Type: text/xml
Server: Apache
Last-Modified: Fri, 25 Mar 2005 22:47:02 GMT
ETag: "30800c-3bf-424494e6"
Via: 1.1 nc2 (NetCache NetApp/5.6R1)
<?xml version="1.0" encoding="UTF-8" ?><server_status poptot="14399" updated="25-03-2005 23:47:00"><lng val="English" poplng="2283"><server name="Excalibur" type="Normal" pop="1178" status="Up"/><server name="Prydwen" type="Normal" pop="595" status="Up"/><server name="Camlann" type="PvP" pop="510" status="Up"/></lng><lng val="French" poplng="4272"><server name="Broceliande" type="Normal" pop="1369" status="Up"/><server name="Ys" type="Normal" pop="1290" status="Up"/><server name="Orcanie" type="Normal" pop="1041" status="Up"/><server name="Carnac" type="Normal" pop="572" status="Up"/></lng><lng val="German" poplng="7844"><server name="Avalon" type="Normal" pop="1894" status="Up"/><server name="Stonehenge" type="Normal" pop="1699" status="Up"/><server name="Lyonesse" type="Normal" pop="1614" status="Up"/><server name="Dartmoor" type="Normal" pop="1322" status="Up"/><server name="Logres" type="Normal" pop="1315" status="Up"/></lng></server_status>
The last line is 960 bytes and cant be loaded into a mirc string 930 (aprox) limit, you well have to switch to &binvar variables and disect the line manually, unless your just downloading it to file anyway, in which case just switch to binvar after the first $null returned %vrs and dump to a file.
some example code (dont know if u needed it)
on *:sockread:servers:{
var %vrs
if (%servers.header) {
sockread %vrs
if (!%vrs) { set -s %servers.header $false | var %vrs = --- header ends --- }
echo -a %vrs
}
;
; * yes the reverse IF condition below is on purpose instead of a using a ELSE
;
if (!%servers.header) {
sockread -fn &binvar
var %i = 1
while (%i <= $sockbr) {
echo -a $bvar(&binvar,%i,512).text
inc %i 512
}
}
}
On using this you sometimes get strange results becuase
When using
sockread -f %vrs it says it reads to a $crlf terminated line or the end of buffer, in fact it reads to a $lf terminated line also (might do $cr as well never checked tho)
But when using
sockread -fn &binvar it says it reads to a $crlf terminated line or the end of buffer, and it really does, a $lf (maybe also $cr) are included in the &binvar
This being the case, if you are parsing out the lines you need to know that you may infact have more than one line in the &binvar.