forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


searching for a string on a web page

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
tim6389
Professional Member
Professional Member


Joined: 01 Aug 2002
Posts: 790

PostPosted: Fri Apr 23, 2004 1:35 am    Post subject: searching for a string on a web page Reply with quote

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 Smile
Back to top
View user's profile Send private message
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Fri Apr 23, 2004 1:44 am    Post subject: Reply with quote

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. Smile

Take a look in the help file for more string processing functions. Smile

_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
tim6389
Professional Member
Professional Member


Joined: 01 Aug 2002
Posts: 790

PostPosted: Fri Apr 23, 2004 1:50 am    Post subject: Reply with quote

yea i think the string does change from red to green this part:


Code:

><font color=red>


to

Code:

><font color=green>


so maybe the way i was thinking won't work Sad

_________________
Have a nice day Smile
Back to top
View user's profile Send private message
SnarlingSheep
Professional Member
Professional Member


Joined: 13 Mar 2001
Posts: 759
Location: Michigan

PostPosted: Fri Apr 23, 2004 2:28 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
SnarlingSheep
Professional Member
Professional Member


Joined: 13 Mar 2001
Posts: 759
Location: Michigan

PostPosted: Fri Apr 23, 2004 2:28 am    Post subject: Reply with quote

Side-note: Aren't the Code tags NOT supposed to wrap?
_________________
-Sheep
My pockets hurt...
Back to top
View user's profile Send private message Send e-mail
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Fri Apr 23, 2004 11:33 am    Post subject: Reply with quote

I believe only the vds tags won't wrap. I'll take a look how to do this for the code tag also... Smile
_________________
[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!
Back to top
View user's profile Send private message
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Fri Apr 23, 2004 11:36 am    Post subject: Reply with quote

I believe this should work... Smile

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group