; example web: Active threads past 24 hours:
; example url: https://forums.mirc.com/ubbthreads.php/activetopics/1/1
alias crashesin761 {
var %url $1, %error
var %t $ticks, %com mforum. $+ %t, %com2 mforum2. $+ %t, %com3 mforum3. $+ %t
.comopen %com MSXML2.SERVERXMLHttp.6.0
if ((!$com(%com)) || ($comerr)) %error = Unable to create an instance of MSXML2.SERVERXMLHttp.6.0
elseif ((!$com(%com, open, 1, bstr, GET, bstr, %url, bool, false)) || ($comerr)) %error = Unable to initialise the request
elseif ((!$com(%com, send, 1)) || ($comerr)) %error = Request failed
else {
if ((!$com(%com, responseText, 2)) || ($comerr)) %error = Failed to retrieve response text
elseif ((!$com(%com, &responseText).result) || ($comerr)) %error = Failed to place result into binvar
else {
.comopen %com2 HTMLFile
echo -a OK1
if ((!$com(%com2)) || ($comerr)) %error = Unable to create an instance of HTMLFile
elseif ((!$com(%com2, write, 3, &bstr, &responseText)) || ($comerr)) %error = Cannot pour binvar into HTMLFile object
elseif ((!$com(%com2, queryselectorall, 3, bstr, table, dispatch* %com3)) || ($comerr)) %error = Hello
else {
if ($com(%com3)) {
var -s %item 0, %items $comval(%com3,0)
}
}
}
}
; Handle errors
:error
if ($error) %error = $v1 | reseterror
; Close coms
if ($com(%com)) .comclose %com
if ($com(%com2)) .comclose %com2
if ($com(%com3)) .comclose %com3
; Show error
if (%error) echo -ag $v1
}