Archive: parsing reply from inetc


parsing reply from inetc
Hi, I trying to use inetc to register to establish a connection to a server, register some details and obtain the the confirmed registration details from the post_reply.

For example, connect with
inetc::post $registrationStr ${REGISTER_CMD} "post_reply.html"

...get this post_reply back...

<html>
<title>Process Registration</title>
<body>
<p>REG_ID=1020</p>
<p>REG_DATE=20070215</p>
</body>
</html>

I was looking for a function that would allow me to pass a key and a seperator in, strip off any unnecessary characters and retrun the key value - say something like:

push "REG_ID" ; the string to look for
push "=" ; the key seperator
call getKeyValue ; answer is "1020"

That way I may also be able to use the same func to parse something like:

<html>
<title>Process Registration</title>
<body>
<p>REG_ID=1020 REG_DATE=20070215</p>
</body>
</html>

Does anyone know if something like this is available?
Thanks.


If you cannot change script (PHP or something else) on server use XML on this (client) side http://forums.winamp.com/showthread....hreadid=227162


thanks for that.
I'll take a look at both options - server and client side.


It would be easiest to change the PHP output to a standard INI file (if you have access), i.e.

[Registration]
REG_ID=1020
REG_DATE=20070215

You can simple use ReadINIStr then.

-Stu