on *:sockopen:news_career:{
if $sockerr { echo -ac info * Sockerr (news_career): $sock($sockname).wsmsg | return }
; Check if you have a variable with cookie data
if $($+(%,$sockname,.cookie),2) {
; if so go ahead and request the page
sockwrite -n $sockname GET /results.asp?search_type=quick&kw=&city=Sault+Ste+Marie HTTP/1.0
sockwrite -n $sockname HOST: www.ospreycareers.com
sockwrite $sockname Cookie: $v1 $+ $str($lf,2)
return
}
; else request headers only (for the cookie)
sockwrite -n $sockname HEAD / HTTP/1.0
sockwrite $sockname HOST: www.ospreycareers.com $+ $str($lf,2)
}
on *:sockread:news_career:{
if $sockerr { echo -ac info * Sockerr (news_career): $sock($sockname).wsmsg | return }
var %a | sockread %a
; Check if you have a cookie
if !$($+(%,$sockname,.cookie),2) {
; if not, check for the cookie data
if *Set-Cookie: ASPSESSIONID* iswm %a {
; set it to a variable
set -u3600 $+(%,$sockname,.cookie) np%5Furl=www%2Esaultstar%2Ecom; $gettok(%a,2,32)
; and start over
sockclose $sockname | news_career
}
}
; else read the page ;)
; IF you have a job title...
if %JobTitle {
; add the date and location data
if *<td class="rowSep"* iswm %a { set -e %JobTitle %JobTitle $regsubex(%a,/\t|<.*?>/g,) }
; if its end of item, display the item & unset the variable
elseif *</tr>* iswm %a { echo -a %JobTitle | unset %JobTitle }
}
; else check incoming data for a job title & set it to a variable
elseif *onMouseout="hideddrivetip()">* iswm %a { set -e %JobTitle $gettok($gettok(%a,1,60),2,62) }
}