sometimes when you do a socket, and it returns a HTTP status code, and you dont understand what it really means you can use
• go to mIRC and press alt+r
• click on file, then new, and paste it into a new remote page
!checkstatus N
where N is a number
example
[18:48:32] <~Dean> !checkstatus 100
[18:48:36] <&Botname> 100 Continue - This means that the server has received the request headers, and that the client should proceed to send the request body (in case of a request which needs to be sent; for example, a POST request). If the request body is large, sending it to a server when a request has already been rejected based upon inappropriate headers is inefficient. To have a server check if the request
[18:48:37] <&Botname> could be accepted based on the requests headers alone, a client must send Expect: 100-continue as a header in its initial request (see RFC 2616 14.20 Expect header) and check if a 100 Continue status code is received in response before continuing (or receive 417 Expectation Failed and not continue).
it dont have a Flood protection, i made it to receive many requests at same time
on $*:text:/^!checkstatus\s(\d+)$/iS:#:{
checkstatus $regml(1) #
}
alias checkstatus {
var %x = $+(status,$ticks,$nick)
if ($sock(%x)) { return }
else {
sockopen %x www.askapache.com 80
sockmark %x $1|msg $2
}
}
on *:sockopen:status*: {
if ($sockerr) { $gettok($sock($sockname).mark,2,124) ERROR: $sock($sockname).wsmsg | return }
else {
var %x sockwrite -n $sockname
%x GET /htaccess/apache-status-code-headers-errordocument.html HTTP/1.1
%x HOST: www.askapache.com
%x
}
}
on *:sockread:status*: {
tokenize 124 $sock($sockname).mark
if ($sockerr) { $2 ERROR: $sock($sockname).wsmsg | return }
else {
var %x
sockread %x
var %t = $regex(%x,/<a href="#status- $+ $1 $+ \b".+>Sample\s(.+)<\/a>\s<br \/>(.+)<\/dd>/)
if (%t) {
$2 $+(,$regml(1),) - $regsubex($regml(2),/<[^>]+>/g,)
sockclose $sockname
}
}
if (</table> isin %x) && (!%t) {
$2 The status code does not exist, or can not be found | sockclose $sockname
}
}
i need to test it into 6.35 so, and check if there is an error on it, so i will warn ppl about the version
i know that the same ppl as ever will score it with 1
try this edit
on $*:text:/^!checkstatus\s(\d+)$/iS:#:{
checkstatus $regml(1) #
}
alias checkstatus {
var %x = $+(status,$ticks,$nick)
if ($sock(%x)) { return }
else {
sockopen %x www.askapache.com 80
sockmark %x $1 $2
}
}
on *:sockopen:status*: {
if ($sockerr) { $gettok($sock($sockname).mark,2,124) ERROR: $sock($sockname).wsmsg | return }
else {
var %x sockwrite -n $sockname
%x GET /htaccess/apache-status-code-headers-errordocument.html HTTP/1.1
%x HOST: www.askapache.com
%x
}
}
on *:sockread:status*: {
tokenize 32 $sock($sockname).mark
if ($sockerr) { $2 ERROR: $sock($sockname).wsmsg | return }
else {
var %x
sockread %x
var %t = $regex(%x,/<a href="#status- $+ $1 $+ \b".+>Sample\s(.+)<\/a>\s<br \/>(.+)<\/dd>/)
if (%t) {
msg $2 $+(,$regml(1),) - $regsubex($regml(2),/<[^>]+>/g,)
sockclose $sockname
}
}
if (</table> isin %x) && (!%t) {
msg $2 The status code does not exist, or can not be found | sockclose $sockname
}
}