| View previous topic :: View next topic |
| Author |
Message |
GeoTrail Valued Contributor


Joined: 18 Feb 2003 Posts: 572 Location: Bergen, Norway
|
Posted: Sun Feb 23, 2003 7:41 am Post subject: Is this possible to parse? |
|
|
I'm wondering if it is possible to parse a chat site...
I use a norwegian chat site which is a html based system using CGI.
Is it possible to take everything between two lines like this:
<!-- Start of chat content -->
<!-- End of chat content -->
and then parse the data so that the usernames, times and chat contents are parsed and any html tags removed.
The output of the chat looks kinda like this:
GeoTrail 08:39 And here is what I have written on the chat.
Username 08:38 And here is what someone else wrote.
and so on.
Is this possible to do and then display the content in an object in VDS? _________________
 |
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Sun Feb 23, 2003 8:04 am Post subject: |
|
|
Probably...
We'll assume the whole string is in %%var...
I'd remove the html tags first, using @pos() and strdel() - there's
several threads in the source code sections on string removal and
replacement.
To get the name and time (providing spaces are NOT allowed in the
name), you can parse them:
OPTION FIELDSEP, " "
PARSE "%%name;%%time", %%var
Then use @substr (or @strdel) to get the text (add 2 to length
for the spaces after name and time):
%%start = @sum(@len(%%name), @len(%%time), 2)
%%var = @substr(%%var, %%start, @len(%%var))
%%var should now contain only the chat text.
Maybe this'll get ya started anyway.
Cheers, Mac  _________________ VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
 |
|
| Back to top |
|
 |
GeoTrail Valued Contributor


Joined: 18 Feb 2003 Posts: 572 Location: Bergen, Norway
|
Posted: Sun Feb 23, 2003 2:38 pm Post subject: |
|
|
Thanks Mac
I'll give that a try. Before sure to await another stupid question here in a short time  _________________
 |
|
| Back to top |
|
 |
ShinobiSoft Professional Member


Joined: 06 Nov 2002 Posts: 790 Location: Knoxville, Tn
|
Posted: Sun Feb 23, 2003 3:54 pm Post subject: |
|
|
For those who are trying and or willing to learm, there is no such thing as
a stupid question. _________________ Bill Weckel
ShinobiSoft Software
"The way is known to all, but not all know it." |
|
| Back to top |
|
 |
GeoTrail Valued Contributor


Joined: 18 Feb 2003 Posts: 572 Location: Bergen, Norway
|
Posted: Sun Feb 23, 2003 4:11 pm Post subject: |
|
|
Well, I'm willing, able and ready to learn  _________________
 |
|
| Back to top |
|
 |
|