| View previous topic :: View next topic |
| Author |
Message |
tim6389 Professional Member


Joined: 01 Aug 2002 Posts: 790
|
Posted: Fri Apr 23, 2004 1:35 am Post subject: searching for a string on a web page |
|
|
hello all
i have been trying to find a way to have vds search a php web page for a string once its found pop open a window...my questions is can i have it search on line or do i have to have it save then page first then search it?
here is the code i'am trying to find
| Code: |
.<BR>The current number of free downloads is: <font color=black><font color=red>427<font color=black><font face='Arial' size='2'> |
note what i'am trying to watch is the "427" number i would like to have it pop open a window when that number is below 200
thanks _________________ Have a nice day  |
|
| Back to top |
|
 |
FreezingFire Admin Team

Joined: 23 Jun 2002 Posts: 3508
|
Posted: Fri Apr 23, 2004 1:44 am Post subject: |
|
|
It doesn't really matter if you save the page to disk or not, but what you
need to do is get the page, then do something like
the following:
| Code: | %%string = ".<BR>The current number of free downloads is: <font color=black><font color=red>427<font color=black><font face='Arial' size='2'>"
info @substr(%%string,81,83) |
That will give you the number in place of 427, provided that the number
of characters before it doesn't change.
Take a look in the help file for more string processing functions.  _________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
| Back to top |
|
 |
tim6389 Professional Member


Joined: 01 Aug 2002 Posts: 790
|
Posted: Fri Apr 23, 2004 1:50 am Post subject: |
|
|
yea i think the string does change from red to green this part:
to
| Code: |
><font color=green>
|
so maybe the way i was thinking won't work  _________________ Have a nice day  |
|
| Back to top |
|
 |
SnarlingSheep Professional Member


Joined: 13 Mar 2001 Posts: 759 Location: Michigan
|
Posted: Fri Apr 23, 2004 2:28 am Post subject: |
|
|
Here's a lil trick that will work as long as the : stays in the sentence before the number:
| Code: |
REM GT-HTMLStrip Care of Garrett
%A = ".<BR>The current number of free downloads is: <font color=black><font color=red>427<font color=black><font face='Arial' size='2'>"
GOSUB GT-HTMLStrip
OPTION FIELDSEP,":"
PARSE "%%words;%%num",%A
info %%num
exit
:GT-HTMLStrip
repeat
if @greater(@pos(<,%A),0)
%b = @pos(<,%A)
%c = @pos(>,%A)
if @equal(%B,1)
%d =
else
%d = @substr(%A,1,@fsub(%B,1))
end
%e = @substr(%A,@sum(%C,1),@len(%A))
%a = %D%E
end
until @not(@greater(@pos(<,%A),0))
exit
|
_________________ -Sheep
My pockets hurt... |
|
| Back to top |
|
 |
SnarlingSheep Professional Member


Joined: 13 Mar 2001 Posts: 759 Location: Michigan
|
Posted: Fri Apr 23, 2004 2:28 am Post subject: |
|
|
Side-note: Aren't the Code tags NOT supposed to wrap? _________________ -Sheep
My pockets hurt... |
|
| Back to top |
|
 |
Skit3000 Admin Team

Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
|
| Back to top |
|
 |
Skit3000 Admin Team

Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
Posted: Fri Apr 23, 2004 11:36 am Post subject: |
|
|
I believe this should work...
| Code: |
%%html = PUT THE CONTENTS OF YOUR WEBSITE HERE
%%before = .<BR>The current number of free downloads is: <font color=black><font color=red>
%%after = <font color=black><font face='Arial' size='2'>
info @strbetween(%%html,%%before,%%after)
exit
:strbetween
exit @substr(%1,@sum(@pos(%2,%1),@len(%2)),@pred(@pos(%3,%1))) |
_________________ [ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial! |
|
| Back to top |
|
 |
|