This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Latest Urban Dictionary tcl

Support & discussion of released scripts, and announcements of new releases.
User avatar
Trixar_za
Op
Posts: 143
Joined: Wed Nov 18, 2009 1:44 pm
Location: South Africa
Contact:

Post by Trixar_za »

Replace:

Code: Select all

  } elseif {[regexp -all -inline {<a class=['"]add_to_list['"] data-defid=['"].*?['"] href=['"]#['"]>(.*?)<a class} $data] != ""} {
    set matches [regexp -all -inline {<a class=['"]add_to_list['"] data-defid=['"].*?['"] href=['"]#['"]>(.*?)<a class} $data];
with

Code: Select all

  } elseif {[regexp -all -inline {<a class=['"]add_to_list['"].*?>(.*?)<a class} $data] != ""} {
    set matches [regexp -all -inline {<a class=['"]add_to_list['"].*?>(.*?)<a class} $data];
and

Code: Select all

regexp -nocase -- {<div class=['"]meaning['"]>(.*?)</div>} $match -> definition 
with

Code: Select all

    if {[regexp -nocase -- {<div class=['"]definition['"]>(.*?)</div>} $match -> definition]} {
	} elseif {[regexp -nocase -- {<div class=['"]meaning['"]>(.*?)</div>} $match -> definition]} {
    }
or you could just download everything from usual link @ http://trixarian.net/downloads/urband.zip
g
goalie204
Halfop
Posts: 44
Joined: Thu Apr 28, 2011 7:31 pm

Post by goalie204 »

Awesome man! Thank you so much!! :o
n
neocharles
Voice
Posts: 34
Joined: Tue Apr 23, 2013 4:29 pm

Post by neocharles »

I need to update this on my eggdrop. Do you add all three tcl files to the source portion in the configs? I just noticed that I do not currently have an http.tcl but I do have fsck and urban.tcl (maybe this is a different release completely?)
User avatar
Trixar_za
Op
Posts: 143
Joined: Wed Nov 18, 2009 1:44 pm
Location: South Africa
Contact:

Post by Trixar_za »

Update time again!

Just replace:

Code: Select all

  } elseif {[regexp -all -inline {<a class=['"]add_to_list['"].*?>(.*?)<a class} $data] != ""} {
    set matches [regexp -all -inline {<a class=['"]add_to_list['"].*?>(.*?)<a class} $data];
  } else {
    set matches "";
  }
with

Code: Select all

  } elseif {[regexp -all -inline {<a class=['"]add_to_list['"].*?>(.*?)<a class} $data] != ""} {
    set matches [regexp -all -inline {<a class=['"]add_to_list['"].*?>(.*?)<a class} $data];
  } elseif {[regexp -all -inline {<div class=['"]word['"]>(.*?)<div class=['"]share['"]} $data] != ""} {
    set matches [regexp -all -inline {<div class=['"]word['"]>(.*?)<div class=['"]share['"]} $data];
  } else {
    set matches "";
  }
or just download the copy at the usual address: http://trixarian.net/downloads/urband.zip

neocharles: The default archive should include http.tcl if you don't already have a working copy. Just add them in this order in the eggdrop.conf file:

Code: Select all

source scripts/http.tcl
source scripts/fsck.tcl
source scripts/urband.tcl
User avatar
spithash
Master
Posts: 249
Joined: Thu Jul 12, 2007 9:21 am
Location: Libera
Contact:

Post by spithash »

This update/fix was one of the quickest ever or what?!

Nobody saw this coming :shock:

You're awesome! 8)
Libera ##rtlsdr & ##re - Nick: spithash
Click here for troll.tcl
User avatar
Trixar_za
Op
Posts: 143
Joined: Wed Nov 18, 2009 1:44 pm
Location: South Africa
Contact:

Post by Trixar_za »

Says the guy that told me about it :P

For those that are interested, I also updated my other urban dictionary script so it works again. This is the one that doesn't depend on fsck.tcl and it works and looks similiar to this one, but only grabs the top most definition. You can get it from http://www.trixarian.net/downloads/urban.tcl if you're interested.
g
goalie204
Halfop
Posts: 44
Joined: Thu Apr 28, 2011 7:31 pm

Post by goalie204 »

reg one not working again :(
User avatar
Trixar_za
Op
Posts: 143
Joined: Wed Nov 18, 2009 1:44 pm
Location: South Africa
Contact:

Post by Trixar_za »

And yet another update. This time to the original script by porting my fixes over to it. So for the people that want the older one, just use urband2.tcl in the zip file at the usual address: http://trixarian.net/downloads/urband.zip

That means you can now have the original look of the script complete with the -ud command, but don't worry, I added the ! and . variations too.

So for the new look, use urband.tcl in your eggdrop.conf and for the old look, use urband2.tcl - simple right?. Also if you want a version that looks like the new one, but doesn't require fsck.tcl, then download http://www.trixarian.net/downloads/urban.tcl

That should appease everybody's tastes now ;)
User avatar
Trixar_za
Op
Posts: 143
Joined: Wed Nov 18, 2009 1:44 pm
Location: South Africa
Contact:

Post by Trixar_za »

Yet another bug fix - this time to allow Urban Dictionary's search function to redirect the url to the correct case of the word (so spam becomes SPAM, etc).

You correct it by replacing:

Code: Select all

  if {![string equal -nocase $state(status) "ok"]} {
    return [list 0 "Warning: Couldn't connect to \[$url\] (connection $state(status))."];
  }
with

Code: Select all

  if {![string equal -nocase $state(status) "ok"]} {
    return [list 0 "Warning: Couldn't connect to \[$url\] (connection $state(status))."];
  }
  foreach {name val} $state(meta) { set meta([string tolower $name]) $val; }
  if {[info exists meta(location)]} {
      set meta(redirect) $meta(location);
  }
  if {[info exists meta(redirect)]} {
     if {[catch {http::geturl $meta(redirect) -timeout 20000} token]} {
        return [list 0 "Warning: Couldn't connect to \[$meta(redirect)\]"];
     }
  }
And the problem should be resolved. The updated version of the scripts can now be found at the usual spot: http://trixarian.net/downloads/urband.zip

Thanks to spithash for pointing out yet another bug in the script :P
User avatar
spithash
Master
Posts: 249
Joined: Thu Jul 12, 2007 9:21 am
Location: Libera
Contact:

Post by spithash »

JOY! 8)
Libera ##rtlsdr & ##re - Nick: spithash
Click here for troll.tcl
User avatar
spithash
Master
Posts: 249
Joined: Thu Jul 12, 2007 9:21 am
Location: Libera
Contact:

Post by spithash »

The script needs update again, I will try to contact Trixar_za. They changed the website layout again I guess
Libera ##rtlsdr & ##re - Nick: spithash
Click here for troll.tcl
User avatar
Trixar_za
Op
Posts: 143
Joined: Wed Nov 18, 2009 1:44 pm
Location: South Africa
Contact:

Post by Trixar_za »

Well, it was only a matter of time before they went and changed it again. Now going for a Bootstrap look it seems.

Anyway, change:

Code: Select all

  } elseif {[regexp -all -inline {<div class=['"]word['"]>(.*?)<div class=['"]share['"]} $data] != ""} {
    set matches [regexp -all -inline {<div class=['"]word['"]>(.*?)<div class=['"]share['"]} $data];
  } else {
    set matches "";
to

Code: Select all

  } elseif {[regexp -all -inline {<div class=['"]word['"]>(.*?)<div class=['"]share['"]} $data] != ""} {
    set matches [regexp -all -inline {<div class=['"]word['"]>(.*?)<div class=['"]share['"]} $data];
  } elseif {[regexp -all -inline {<div class=['"]row['"]>(.*?)<div class=['"]def-footer['"]} $data] != ""} {
    set matches [regexp -all -inline {<div class=['"]row['"]>(.*?)<div class=['"]def-footer['"]} $data];
  } else {
    set matches "";
and it should work again.

You can also get the fixed code at the usual link: http://trixarian.net/downloads/urband.zip
User avatar
spithash
Master
Posts: 249
Joined: Thu Jul 12, 2007 9:21 am
Location: Libera
Contact:

Post by spithash »

Thanks a lot man :D
Libera ##rtlsdr & ##re - Nick: spithash
Click here for troll.tcl
User avatar
Trixar_za
Op
Posts: 143
Joined: Wed Nov 18, 2009 1:44 pm
Location: South Africa
Contact:

Post by Trixar_za »

Been broken for a while, but...
Change

Code: Select all

  } elseif {[regexp -all -inline {<div class=['"]row['"]>(.*?)<div class=['"]def-footer['"]} $data] != ""} {
    set matches [regexp -all -inline {<div class=['"]row['"]>(.*?)<div class=['"]def-footer['"]} $data];
  } else {
    set matches "";
  }
to

Code: Select all

  } elseif {[regexp -all -inline {<div class=['"]row['"]>(.*?)<div class=['"]def-footer['"]} $data] != ""} {
    set matches [regexp -all -inline {<div class=['"]row['"]>(.*?)<div class=['"]def-footer['"]} $data];
  } elseif {[regexp -all -inline {<div class=['"]def-header['"]>(.*?)<div class=['"]def-footer['"]} $data] != ""} {
    set matches [regexp -all -inline {<div class=['"]def-header['"]>(.*?)<div class=['"]def-footer['"]} $data];
  } else {
    set matches "";
  }
or grab it from the usual spot: http://trixarian.net/downloads/urband.zip
User avatar
spithash
Master
Posts: 249
Joined: Thu Jul 12, 2007 9:21 am
Location: Libera
Contact:

Post by spithash »

hey man, are you sure that this works? because I get this:

Code: Select all

Tcl error [::urbandict::pub]: can't read "define": no such variable
Tcl error [::urbandict::pub]: can't read "example": no such variable
Libera ##rtlsdr & ##re - Nick: spithash
Click here for troll.tcl
Post Reply