Create a class for searching Yahoo! results.

It must implement a Next Page method, and read URL, Title and Content from results.




'--------------------------------------------------------------------------
' send this from the server to the clients browser
'--------------------------------------------------------------------------
html "<table border=1 cellpadding=0 cellspacing=0 bgcolor=wheat>"
html "<tr><td align=center colspan=2>Yahoo Search</td></tr>"
html "<tr><td align=right>Find</td><td>"
     textbox #find,findThis$,30
 
html "</td></tr><tr><td align=right>Page</td><td>"
     textbox #page,findPage$,2
 
html "</td></tr><tr><td align=center colspan=2>"
     button #s, "Search", [search]
html "        "
     button #ex, "Exit", [exit]
 
html "</td><td></td></tr></table>"
wait
 
'--------------------------------------------------------------------------
' get search stuff from the clients browser
'--------------------------------------------------------------------------
[search]
findThis$  = trim$(#find contents$())
findPage$  = trim$(#page contents$())
findPage   = max(val(findPage$),1)           ' must be at least 1
 
'--------------------------------------------------------------------------
' sho page but keep user interface at the top by not clearing the page (cls)
'  so they can change the search or page
' -------------------------------------------------------------------------
url$ = "http://search.yahoo.com/search?p=";findThis$;"&b=";((findPage - 1) * 10) + 1
html httpget$(url$)
wait
 
[exit]
cls                   ' clear browser screen and get outta here
wait