Old 21st February 2007, 07:37   #1
drod
Junior Member
 
Join Date: Jan 2007
Location: UK
Posts: 9
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.
drod is offline   Reply With Quote
Old 21st February 2007, 13:44   #2
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
If you cannot change script (PHP or something else) on server use XML on this (client) side http://forums.winamp.com/showthread....hreadid=227162
Takhir is offline   Reply With Quote
Old 21st February 2007, 18:13   #3
drod
Junior Member
 
Join Date: Jan 2007
Location: UK
Posts: 9
thanks for that.
I'll take a look at both options - server and client side.
drod is offline   Reply With Quote
Old 21st February 2007, 23:00   #4
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
It would be easiest to change the PHP output to a standard INI file (if you have access), i.e.
code:
[Registration]
REG_ID=1020
REG_DATE=20070215


You can simple use ReadINIStr then.

-Stu
Afrow UK is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump