Jack,
I just did a quicky conversion of the aforementioned script. It queries my own discount brokerage here in Canada. You run it like this:
C:\>kix32 quote $stock=SVM $exchange=x
Here's the source:
QUOTE.KIX
break on
;
; SCRIPT: quote.kix
;
; USAGE: kix32 quote $stock=symbol $exchange=exchange
;
; EXAMPLE: kix32 quote $stock=brk.b $exchange=x (Berkshire Hathaway on New York)
; EXAMPLE: kix32 quote $stock=td $exchange=t (Toronto Dominion Bank on Toronto)
;
; Submits a cgi request and parses returned html for information...
;
; Check command line parameters & set defaults ...
if $stock
else
$stock = "BRK.B"
endif
if $exchange
else
$exchange = "X"
endif
$URL = 'http://www.bmoinvestorline.com/cgi-bin/t3i.3.cgi/e/ilmquote.taf?textfield=$stock&Exchange=$exchange'
$PARSE1 = 'Last: '
$CRLF = CHR(13)+CHR(10)
?"Searching "
$ie = createobject("internetexplorer.application") "."
$ie.navigate($URL) "."
while $ie.readystate <> 4 and $ie.busy and @error = 0 loop "."
while $ie.document.readystate <> "complete" and @error = 0 loop "."
$html = $ie.document.documentelement.innerhtml
$len = len("$html")
$pos = instr("$html", "$PARSE1" )
if $pos
$pos = $pos + len("$PARSE1")
$html = substr("$html", $pos, $len)
$price = substr("$html",1,instr("$html"," ")-1)
?
?"$stock:$exchange = $price"
?
else
?"Error getting stock quote"
endif
; Cleanup ...
$ie.quit
$ie = 0
exit 1
I guess the other way you might consider doing this is to create a DAT or INI file on a share somewhere, then build a tool that updates this dat file (batch job), then query this file in your login scripts. Might be faster and easier to maintain.
-Shawn
[ 02 May 2002, 14:57: Message edited by: Shawn ]