Bash Quote Grabber
Posted by HellRaz0r
Saturday, September 09, 2006
Description: :), could be better but didnt want to waste to long on it.
;/bash
alias bash {
.sockclose bash | .sockopen bash bash.org 80
}
on *:sockopen:bash:{
sockwrite -n $sockname GET /?random HTTP/1.1
sockwrite -n $sockname Host: $sock($sockname).ip
sockwrite -n $sockname Connection: Close
sockwrite -n $sockname $crlf
}
on *:sockread:bash:{
var %data | sockread %data
if $regex(%data,<p class="qt">(.*)<\/p>) { echo -a $nohtml($regml(1)) | .sockclose $sockname | return }
}
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))))
}