!Slang

By MyWebs on Aug 13, 2007

Version 1.1

UPDATED!
I added flood protection so any regular user in a channel can't use it more than 3 times in 30 seconds.

This script can be used to look up a slang word definition from Urban Dictionary.
Usage: !slang 1 word
(This retrives the first result for word of 53 results.) i.e. 1/53
!slang 2 word
(Retrives the second result for word.) i.e. 2/53
!Random (Retrives a random slang word)
!Related Word (finds up to 10 words with a similar meaning to word)
!Nearby Word (finds 10 words listed nearby word alphabetically)
!wod retrives todays Word Of the Day.
!spell word (uses google suggest function which isn't all that great imo)
!slanghelp will list usage examples.

Since this script uses my web sites resources I would appreciate a link to http://www.MyWebs.biz/ in exchange for me allowing others to use my bandwidth and resources. If you have a web page somewhere please put up a link to my site using My Webs as the link text. (without the *'s) Example HTML code is included in the script up top! Thank You!

Most of this scripts logic is written in PHP, on my web site, that uses SOAP to connect to Urban Dictionary's API. This IRC script mostly just passes the variables via GET variables to my web page. This is where the real work is done.

One known bug: When you look up a word with an apostrophe ' it won't return any results when it should. Its not that big of a deal since not many words have an ' in them. If anyone can solve this please comment below.

This IRC script also uses another persons socket code. URL: http://www.mircscripts.com/cgi-bin/file.php?id=897 This code is mostly left unchanged. It doesn't always properly split the message into small enough chunks and you won't always see the whole thing that gets returned because its too long. If anyone finds a fix for this please comment the script and I will update the IRC script code.
WARNING: Urban Dictionary is not appropriate for all audiences! Slang words often contains curse words!
Thank You,
MyWebs

Image

Comments

Sign in to comment.
opensource   -  Jan 09, 2011

I have taken the time to join and hope someone can help ?

 Respond  
opensource   -  Jan 09, 2011

Urbandictionary.com what script?
Hi everyone,

Do you have any idea what script www[dot]urbandictionary[dot]com is using? or any similar script?

I want to start my own small dictionary site similar to UrbanDictionary.com.. Please suggest a good script that could function like that.

thanks!

 Respond  
uneek   -  Jul 11, 2008

Thanks mate! Been looking for one that works with the sites new updates for a while! It was a very popular script in a channel of mine :D

I added a link to your site as well to show my support. http://www.mydamnsig.com

 Respond  
napa182   -  May 21, 2008

you need to find this in the socketread part and use this

elseif (%temp != $null) {
      if ($hget($sockname, chunked)) {
        if (%chunked) {
          inc %read $calc($sockbr + 2)
          if (%read >= %len) { %chunked = $false }
          .notice %slangnick $hget($sockname, info) %temp
        }
        else {
          %read = 0
          %len = $base($gettok(%temp, 1, 32), 16, 10)
          %chunked = $true
        }
      }
      else {
        .notice %slangnick $hget($sockname, info) %temp
      }
    }
  }
}

that should make it notice

 Respond  
napa182   -  May 21, 2008

um you wont beable to change the php side of this script cuz it\'s not on here. Tony has this set up to send the info to his page then it pulls it from there to mirc.
but you can replace the !slang part with this

 on *:TEXT:!Slang *:#: {
  if ($2 !isnum) { .notice $nick  $2 is not a number. Enter a number for the number of the result you want. i.e !slang 1 $2- | halt }
  set %slangchan2 $chan
  set %slangnick $nick
  set %Asc2  $replace($3-,$chr(32),$chr(37) $+ 20)
  ;set %Asc2  $replace($3-,$chr(32),+)
  set %Asc3  $replace(%Asc2,$chr(39),$chr(37) $+ 27)
  ;set %Asc3  $replace(%Asc2,$chr(39),% $+ 27)
  ;/msg %slangchan2 Variable Asc3: %Asc3
  set %SlangURLS http://www.mywebs.biz/IRC/Slang.php?Word= $+  %Asc3
  set %SlangURLS2 %SlangURLS $+ &Count=
  set %SlangURLS3 %SlangURLS2 $+ $$2
  ;/msg %slangchan2 URL: %SlangURLS3
  /request example2 %SlangURLS3 %slangchan2 11,2
  unset %slang* %Asc*
}
 Respond  
Phoenix847   -  May 21, 2008

Yes, but I\'ve never tried to script PHP or learn it at least lol. I\'m totally lost with it.
But from the random testing of just trying stuff, I\'ve found Line 149 - \" /request example2 %SlangURLS7 $chan 4,1\", if you change $chan to $nick, it will PM the person instead... My only problem is changing it do a .notice message.
However for the messaging $chan part... thats simple, leave it the same and change !slang to @slang =/ BUT I still need it to be .msg
So Napa, as smart as you are, you might be able to give me a hint :P

 Respond  
napa182   -  May 21, 2008

well it all depends on how long the first deff for the slang is. some are longer then others and will flood, but on the msg and notice part you can change ur self but on the php side of things it will stay the same.

 Respond  
Phoenix847   -  May 21, 2008

Actually, this can still be used for spam. My friend did \"!slang 2 Noob\" and a lot of messages starting appearing in the channel and eventually led to Excess Flood.
Could you make it possible on !slang it will do a \".notice $nick\"
And on a @slang it will do a \".msg $chan\"

That would be greatly appreciated, and I say the . before msg/notice as it won\'t flood me, if you didn\'t know that :p

 Respond  
guest598594   -  Apr 10, 2008

You could just \"unset %slang %related\" etc

 Respond  
MyWebs   -  Sep 23, 2007

I upgraded !Slang so it now has flood protection.
I don\'t think it was probably a problem really but its there now.
MyWebs

 Respond  
MyWebs   -  Aug 13, 2007

Thanks napa182.
I\'d like to clarify one point. If you look up a word and see more than 1 result returned you can look up each and every result one at a time.
For example if you type !Slang 1 bed ... you will see:

(1/8)-bed Definition a matress on a stand or on the floor (lol) that has a blanket and pillows on it and u got to sleep on it coz sleep is so good Example im gonna go hit the sac... then im gonna go to bed ;) Author flash URL http://www.urbandictionary.com/define.php?term=bed&defid=778262 [782]

That 8 means there are 8 entries for bed. To see the next result you can type !Slang 2 bed all the way up to !slang 8 bed. Some Slang words have hundreds of entries. They are ranked by most votes.
Some entries are quite long and will flood ur channel. Not much I can do about that really. lol
Thanks,
MyWebs

 Respond  
napa182   -  Aug 13, 2007

woot about time Tony =P .. I love the script it rocks.

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.