<%
'extract.asp (c) 2000 Thomas Winningham - use freely!
Function GetCell(cellnumber, extracturl)
'Variables: Cellnumber: Number of the cell to get data from
'ExtractURL: complete url that contains the cells and data
'Returns a string of the cells data (including html)
'Use the SOFTWING.AspTear component to get the HTML (but any
'will do... just rewrite this part) connection is including in
'Function for purpose of being self-contained
Const Request_POST = 1
Const Request_GET = 2
Set xObj = Server.CreateObject("SOFTWING.AspTear")
strRetVal = xObj.Retrieve(extracturl,Request_GET,"","","")
set xobj = nothing
i = 1 ' HTML Text Location Start
q = 1 ' Cell Number Start
' Loop until we have processed the cell we're looking for
Do until q > cellnumber
' Look for | ")
' Let the next loop start looking after this | 0) AND _
(InStr(r, UCase(strRetVal), "")) then
ThisCellText = mid(strRetVal, StartCellText, _
InStr(r, UCase(strRetVal),"")- StartCellText )
End If
GetCell = ThisCellText
End Function
Function NumberCells(extracturl)
'Variables: ExtractUrl: The URL (eg http://www.cnn.com) to number
'returns a string of the entire HTML document with numbers at the beginning
'of each cell
'Use the SOFTWING.AspTear component to get the HTML (but any will do...
'just rewrite this part)
'connection is including in Function for purpose of being self-contained
Const Request_POST = 1
Const Request_GET = 2
Set xObj = Server.CreateObject("SOFTWING.AspTear")
strRetVal = xObj.Retrieve(extracturl,Request_GET,"","","")
set xobj = nothing
i = 1 ' HTML Text Location Start
q = 1 ' Cell Number Start
' So long as | 0
' find next | ")
strRetVal = left(strRetVal, r) & q & _
right(strRetVal, len(strRetVal) - r)
'Number the cells: the string equals all the html we've check,
'our cell number, and then the html we've yet to check
' Let the next loop start looking after this |
| |