# Script investbulls.txt
# Input arguments - user name, password
var string username, password
var string out, downloadlink, description, zipfile
isstart ib "daily download of EOD" "Mozilla/4.0"
isconnect ib "http://www.investbulls.com" > $out
issubmit ib "/news.php" ("username="+$username) ("userpass="+$password) "autologin=0" "userlogin=Login" > null
script SS_ISCookies.txt from("ib") to("ib")
isretrieve ib "/download.php?list.40" > $out
stex -c "]^<a href='download.php?view^" $out > null
stex -c "^<a href='^]" $out > null
stex -c "]^'^" $out > $downloadlink
stex -c "^'>^]" $out > null
stex -c "]^<^" $out > $description
set $zipfile=$description+".zip"
isretrieve ib $downloadlink > $out
stex -c "]^<a href='request.php?^" $out > null
stex -c "^<a href='^]" $out > null
stex -c "]^'^" $out > $downloadlink
isretrieve -b ib $downloadlink > $out
issave -b ib $zipfile
system ("\""+$zipfile+"\"")
isretrieve ib "index.php?logout" > null
isdisconnect ib
isend ib