rendered paste bodyalias bash { dialog -m bash bash }
dialog Bash {
title "Bash.Org"
size -1 -1 174 108
option dbu
button "Random", 1, 8 39 35 11
edit "", 2, 49 23 120 77, vsbar multi
edit "Quote Info Soon To Come", 3, 4 6 165 12, disable center
edit "", 7, 8 59 35 10
button ">", 6, 18 73 14 12
box "Get Quote", 4, 4 23 43 77
menu "File", 8
item "Quit", 9, 8, ok
}
on *:DIALOG:bash:sclick:*:{
if ($did == 1) {
did -r bash 2
bashgetrand
}
elseif ($did == 6) {
did -r bash 2
bashgetnum $did(bash,7).text
}
}
alias bashgetrand {
set %bash.get.type rand
if ($sock(0909478bashget)) { sockclose 0909478bashget }
sockopen 0909478bashget stirk.org 80
}
alias bashgetnum {
set %bash.get.type $1
if ($sock(0909478bashget)) { sockclose 0909478bashget }
sockopen 0909478bashget stirk.org 80
}
on *:SOCKOPEN:0909478bashget:{
sockwrite -n $sockname GET /parsers/bash.php?id= $+ %bash.get.type HTTP/1.1
sockwrite -n $sockname Host: www.stirk.org $+ $crlf $+ $crlf
}
on *:SOCKREAD:0909478bashget:{
var %read
sockread %read
if (*<br />* iswm %read) {
did -a Bash 2 $nohtml(%read) $crlf
}
}
alias nohtml {
var %nohtml = $regsubex($regsubex($1,/<.+?>/g,),/&#(\d+);/g,$fixentities(\t))
%nohtml = $replacecs(%nohtml,",",',',&,&,<,<,>,>, ,$chr(160),¡,¡,¤,¤,¢,¢,£,£,¥,¥,¦,¦,§,§)
%nohtml = $replacecs(%nohtml,¨,¨,©,©,ª,ª,«,«,¬,¬,­,-,®,®,™,,¯,¯,°,°,±,±,²,²,³,³,´,´)
%nohtml = $replacecs(%nohtml,µ,µ,¶,¶,·,·,¸,¸,&supl;,¹,º,º,»,»,¼,¼,½,½,¾,¾,¿,¿,×,×)
%nohtml = $replacecs(%nohtml,÷r;,÷)
%nohtml = $replacecs(%nohtml,À,À,Á,Á,Â,Â,Ã,Ã,Ä,Ä,Å,Å,&Aelig;,Æ,Ç,Ç,È,È,É,É,Ê,Ê)
%nohtml = $replacecs(%nohtml,Ë,Ë,Ì,Ì,Í,Í,Î,Î,Ï,Ï,Ð,Ð,Ñ,Ñ,Ò,Ò,Ó,Ó,Ô,Ô,Õ,Õ,Ö,Ö)
%nohtml = $replacecs(%nohtml,Ø,Ø,Ù,Ù,Û,Ú,Ü,Ü,Ý,Ý,Þ,Þ,à,à,á,á,â,â,ã,ã,ä,ä,å,å)
%nohtml = $replacecs(%nohtml,æ,æ,ç,ç,à,è,é,é,ê,ê,ë,ë,ì,ì,í,í,î,î,ï,ï,ð,ð,ñ,ñ)
%nohtml = $replacecs(%nohtml,ò,ò,ó,ó,ô,ô,õ,õ,ö,ö,ø,ø,ù,ù,ú,ú,û,û,ü,ü,ý,ý,þ,þ)
%nohtml = $replacecs(%nohtml,ÿ,ÿ,Œ,,&celig;,,Š,,š,,Ÿ,,ˆ,,˜,,–,,—,,‘,,’,)
%nohtml = $replacecs(%nohtml,‚,,“,,”,,„,,†,,‡,,…,
,‰,,‹,,›,,€,)
return %nohtml
}
alias -l fixentities {
if ($1 < 128) return $chr($1)
elseif ($1 isnum 128-2047) return $chr($calc(192 + ($1 / 64))) $+ $chr($calc(128 + ($1 % 64)))
elseif ($1 isnum 2048-65535) return $+($chr($calc(224 + ($1 / 4096))),$chr($calc(128 + (($1 / 64) % 64))),$chr($calc(128 + ($1 % 64))))
}