Update This script now requires https so you must install Openssl to use this script.
Download and install OpenSSL: http://www.mirc.com/download/openssl/openssl-0.9.8r-setup.exe
This script searches encyclopediadramatica.com for your search item. If no search word is given, it will give results from a random word.
This script was requested by weishaupt.
Syntax for the script is !dramatica search word(s) or just plain !dramatica for random.
There is a ! trigger that will notice the user and a @ trigger that will message the channel if the user has halfops or higher.
Disclaimer
Just like the urban dictionary site, this site can render some very RUDE results. From my testing, I found some results to be racially insensitive. I also found some to be very anti-American.
It is up to the bot/channel owner to determine if this script is appropriate for their channel/network.
;Encyclopedia Dramatica Search Script by Ford_Lawnmower -- irc.Geekshed.net #Script-Help
menu Channel,Status {
.$iif($group(#dramatica) == On,$style(1)) Encyclopedia Dramatica Trigger
..$iif($group(#dramatica) == On,$style(2)) On: .enable #dramatica
..$iif($group(#dramatica) == Off,$style(2)) Off: .disable #dramatica
}
#dramatica on
On $*:Text:/^(!|@)dramatica.*/Si:#: {
if ($timer($+(dramatica,$network,$nick))) { return }
.timer $+ $+(dramatica,$network,$nick) 1 4 noop
var %method $iif($regml(1) == !,.notice $nick,$iif($regex($nick($chan,$nick).pnick,/(!|~|&|@|%)/),.msg $chan,.notice $nick))
if (!$sslready) %method ssl not found! Please contact the administrator of this bot and inform him/her of this situation.
else dramaticaS %method $2-
}
#dramatica end
alias dramatica { dramaticaS echo -a $1- }
alias -l dramaticaS {
$1-2 Searching........
var %sockname $+(dramaticaS,$network,$2,$ticks)
sockopen -e %sockname encyclopediadramatica.se 443
sockmark %sockname $1-2 $iif($3,$+(/Special:Search/,$replace($3-,$chr(32),+)),/Special:Random) 0 $iif(!$3,1,0)
}
alias -l dramaticaR {
var %sockname $+(dramaticaR,$network,$2,$ticks)
sockopen -e %sockname encyclopediadramatica.se 443
sockmark %sockname $1-2 $+(/,$3) 0 $iif($4,1,0)
}
On *:sockopen:dramatica*: {
if (!$sockerr) {
sockwrite -nt $sockname GET $gettok($sock($sockname).mark,3,32) HTTP/1.0
sockwrite -n $sockname Host: encyclopediadramatica.se
sockwrite -n $sockname $crlf
}
else { echo -st Socket Error $nopath($script) | sockclose $sockname | return }
}
On *:sockread:dramaticaS*: {
if ($sockerr) { echo -st Socket Error $nopath($script) | sockclose $sockname | return }
else {
var %dramaticaS | sockread %dramaticaS
if (Page title matches isincs %dramaticaS) { sockmark $sockname $puttok($sock($sockname).mark,1,4,32) }
if (Page text matches isincs %dramaticaS) { sockmark $sockname $puttok($sock($sockname).mark,1,4,32) }
if ($gettok($sock($sockname).mark,4,32)) && ($regex(%dramaticaS,/\Q<li><a href="/\E(.*)\Q" title="\E/)) {
dramaticaR $gettok($sock($sockname).mark,1-2,32) $regml(1) $gettok($sock($sockname).mark,5,32)
sockclose $sockname
return
}
if (Location: isin %dramaticaS) {
dramaticaR $gettok($sock($sockname).mark,1-2,32) $nopath(%dramaticaS) $gettok($sock($sockname).mark,5,32)
sockclose $sockname
return
}
}
}
On *:sockread:dramaticaR*: {
if ($sockerr) { echo -st socket error $nopath($script) }
else {
var %dramaticaR | sockread %dramaticaR
if (ED FORUMS !isincs %dramaticaR) {
if (*<p>*<b>* iswm %dramaticaR) || (*<p>*<i>* iswm %dramaticaR) {
sockmark $sockname $puttok($sock($sockname).mark,$calc($gettok($sock($sockname).mark,4,32) + 1),4,32)
}
if ($gettok($sock($sockname).mark,4,32)) && ($httpstrip(%dramaticaR)) {
put $gettok($sock($sockname).mark,1-2,32) $v1 $+(,http://encyclopediadramatica.se,$gettok($sock($sockname).mark,3,32))
sockclose $sockname
return
}
}
}
}
On *:sockclose:dramatica*: {
if ($gettok($sock($sockname).mark,5,32)) && (dramaticaR* iswm $sockname) { dramaticaS $gettok($sock($sockname).mark,1-2,32) }
else { $gettok($sock($sockname).mark,1-2,32) Sorry No results found for your Search }
}
alias -l httpstrip { var %x, %i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x) | return $remove($replace(%x,&,&), ,<) }
alias -l Put {
if (!$regex($1,/(\.|^)(msg|notice|echo)$/Si)) || (!$3) { echo -st **Put error** Syntax /Put msg #channel text - or - /Put notice nickname text | return }
var %tokens $0, %Tstart 3, %Dtimer 1500
if ($timer($+(Put,$2,$network)).secs) { %Dtimer = $calc($v1 * 1000) }
while ($len($($+($,%Tstart,-,%tokens),2)) > 430) {
dec %tokens
if ($len($($+($,%Tstart,-,%tokens),2)) <= 430) {
.timer -m 1 %Dtimer $1-2 $($+($,%Tstart,-,%tokens),2))
inc %Dtimer 1500
%Tstart = $calc(%tokens + 1)
%tokens = $0
}
}
.timer -m 1 %Dtimer $1-2 $($+($,%Tstart,-,%tokens),2))
.timer $+ $+(Put,$2,$network) -m 1 $calc(%Dtimer + 1500) noop
}
@FordLawnmower i get this one : [16/06/13|13:56:56] Socket Error dramatica
:/
i switched the URL to encyclopediadramatica.ch
and it worked i think
[3:31pm] <04~toclafane> @dramatica
[3:31pm] <03&ThunderBolt> Searching........
[3:31pm] <03&ThunderBolt> Muzz, a.k.a. Shelley Eve, is a furry artist who specializes in perfectly proportionate anatomy as seen in her lovely art. Her favorite past times include going on deletion sprees all over the internets after she has been told that she is a bitch. She has done this many times, and can be seen throughout her galleries as all of them are as full as a black person's pantry. In a further effort
[3:31pm] <03&ThunderBolt> to prove that she is an adult that
[3:31pm] <03&ThunderBolt> can handle criticism she also got a sock puppet account here at ED and tried to blank this page. http://encyclopediadramatica.com/Muzz
I laughed my @#$% off when I saw this -->> http://encyclopediadramatica.com/Hawkee
You're probably right ^Neptune. I had never even heard of encyclopediadramatica until a few days ago. It's still pretty funny though :D
!Uncyclopedia -->> http://www.hawkee.com/snippet/6710/
@PackardBell , @MashhitDK This script is now updated and working.
Update This script now requires https so you must install Openssl to use this script.
Download and install OpenSSL: http://www.mirc.com/download/openssl/openssl-0.9.8r-setup.exe
If you are not sure if you already have Openssl installed, type //echo -ga $sslready
If it returns $true, you are fine. Otherwise you must install Openssl.