| View previous topic :: View next topic |
| Author |
Message |
Trixar_za Op

Joined: 18 Nov 2009 Posts: 143 Location: South Africa
|
Posted: Wed Mar 12, 2014 7:03 am Post subject: |
|
|
Replace: | Code: | } 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: | } 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: | | regexp -nocase -- {<div class=['"]meaning['"]>(.*?)</div>} $match -> definition | with | Code: | 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 _________________ http://www.trixarian.net/Projects |
|
| Back to top |
|
 |
goalie204 Halfop
Joined: 28 Apr 2011 Posts: 44
|
Posted: Tue Mar 18, 2014 9:22 am Post subject: |
|
|
Awesome man! Thank you so much!!  |
|
| Back to top |
|
 |
neocharles Voice
Joined: 23 Apr 2013 Posts: 34
|
Posted: Tue Apr 01, 2014 11:27 am Post subject: |
|
|
| 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?) |
|
| Back to top |
|
 |
Trixar_za Op

Joined: 18 Nov 2009 Posts: 143 Location: South Africa
|
Posted: Fri Apr 18, 2014 5:21 pm Post subject: |
|
|
Update time again!
Just replace: | Code: | } 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: | } 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: | source scripts/http.tcl
source scripts/fsck.tcl
source scripts/urband.tcl |
_________________ http://www.trixarian.net/Projects |
|
| Back to top |
|
 |
spithash Master

Joined: 12 Jul 2007 Posts: 248 Location: Libera
|
Posted: Fri Apr 18, 2014 5:29 pm Post subject: |
|
|
This update/fix was one of the quickest ever or what?!
Nobody saw this coming
You're awesome!  _________________ Libera ##rtlsdr & ##re - Nick: spithash
Click here for troll.tcl |
|
| Back to top |
|
 |
Trixar_za Op

Joined: 18 Nov 2009 Posts: 143 Location: South Africa
|
Posted: Sat Apr 19, 2014 10:35 am Post subject: |
|
|
Says the guy that told me about it
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. _________________ http://www.trixarian.net/Projects |
|
| Back to top |
|
 |
goalie204 Halfop
Joined: 28 Apr 2011 Posts: 44
|
Posted: Sun Apr 20, 2014 10:31 pm Post subject: |
|
|
reg one not working again  |
|
| Back to top |
|
 |
Trixar_za Op

Joined: 18 Nov 2009 Posts: 143 Location: South Africa
|
Posted: Tue Apr 22, 2014 7:26 pm Post subject: |
|
|
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  _________________ http://www.trixarian.net/Projects |
|
| Back to top |
|
 |
Trixar_za Op

Joined: 18 Nov 2009 Posts: 143 Location: South Africa
|
Posted: Fri May 16, 2014 4:39 pm Post subject: |
|
|
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: | if {![string equal -nocase $state(status) "ok"]} {
return [list 0 "Warning: Couldn't connect to \[$url\] (connection $state(status))."];
} | with | Code: | 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  _________________ http://www.trixarian.net/Projects |
|
| Back to top |
|
 |
spithash Master

Joined: 12 Jul 2007 Posts: 248 Location: Libera
|
Posted: Fri May 16, 2014 4:48 pm Post subject: |
|
|
JOY!  _________________ Libera ##rtlsdr & ##re - Nick: spithash
Click here for troll.tcl |
|
| Back to top |
|
 |
spithash Master

Joined: 12 Jul 2007 Posts: 248 Location: Libera
|
Posted: Wed Nov 05, 2014 2:11 pm Post subject: |
|
|
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 |
|
| Back to top |
|
 |
Trixar_za Op

Joined: 18 Nov 2009 Posts: 143 Location: South Africa
|
Posted: Thu Nov 06, 2014 2:53 am Post subject: |
|
|
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: | } 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: | } 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 _________________ http://www.trixarian.net/Projects |
|
| Back to top |
|
 |
spithash Master

Joined: 12 Jul 2007 Posts: 248 Location: Libera
|
Posted: Thu Nov 06, 2014 10:11 am Post subject: |
|
|
Thanks a lot man  _________________ Libera ##rtlsdr & ##re - Nick: spithash
Click here for troll.tcl |
|
| Back to top |
|
 |
Trixar_za Op

Joined: 18 Nov 2009 Posts: 143 Location: South Africa
|
Posted: Sun Jun 28, 2015 12:15 pm Post subject: |
|
|
Been broken for a while, but...
Change | Code: | } 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: | } 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 _________________ http://www.trixarian.net/Projects |
|
| Back to top |
|
 |
spithash Master

Joined: 12 Jul 2007 Posts: 248 Location: Libera
|
Posted: Sat Jul 11, 2015 6:30 pm Post subject: |
|
|
hey man, are you sure that this works? because I get this:
| Code: | 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 |
|
| Back to top |
|
 |
|