egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Latest Urban Dictionary tcl
Goto page Previous  1, 2, 3, 4, 5, 6  Next
 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases
View previous topic :: View next topic  
Author Message
Trixar_za
Op


Joined: 18 Nov 2009
Posts: 143
Location: South Africa

PostPosted: Wed Mar 12, 2014 7:03 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
goalie204
Halfop


Joined: 28 Apr 2011
Posts: 44

PostPosted: Tue Mar 18, 2014 9:22 am    Post subject: Reply with quote

Awesome man! Thank you so much!! Surprised
Back to top
View user's profile Send private message
neocharles
Voice


Joined: 23 Apr 2013
Posts: 34

PostPosted: Tue Apr 01, 2014 11:27 am    Post subject: Reply with quote

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
View user's profile Send private message
Trixar_za
Op


Joined: 18 Nov 2009
Posts: 143
Location: South Africa

PostPosted: Fri Apr 18, 2014 5:21 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
spithash
Master


Joined: 12 Jul 2007
Posts: 245
Location: DALnet, EFnet & Freenode

PostPosted: Fri Apr 18, 2014 5:29 pm    Post subject: Reply with quote

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

Nobody saw this coming Shocked

You're awesome! Cool
_________________
DALnet #CodeMasters - EFnet #eggtcl Nick: spithash
Click here for troll.tcl
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
Trixar_za
Op


Joined: 18 Nov 2009
Posts: 143
Location: South Africa

PostPosted: Sat Apr 19, 2014 10:35 am    Post subject: Reply with quote

Says the guy that told me about it Razz

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
View user's profile Send private message Visit poster's website
goalie204
Halfop


Joined: 28 Apr 2011
Posts: 44

PostPosted: Sun Apr 20, 2014 10:31 pm    Post subject: Reply with quote

reg one not working again Sad
Back to top
View user's profile Send private message
Trixar_za
Op


Joined: 18 Nov 2009
Posts: 143
Location: South Africa

PostPosted: Tue Apr 22, 2014 7:26 pm    Post subject: Reply with quote

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 Wink
_________________
http://www.trixarian.net/Projects
Back to top
View user's profile Send private message Visit poster's website
Trixar_za
Op


Joined: 18 Nov 2009
Posts: 143
Location: South Africa

PostPosted: Fri May 16, 2014 4:39 pm    Post subject: Reply with quote

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 Razz
_________________
http://www.trixarian.net/Projects
Back to top
View user's profile Send private message Visit poster's website
spithash
Master


Joined: 12 Jul 2007
Posts: 245
Location: DALnet, EFnet & Freenode

PostPosted: Fri May 16, 2014 4:48 pm    Post subject: Reply with quote

JOY! Cool
_________________
DALnet #CodeMasters - EFnet #eggtcl Nick: spithash
Click here for troll.tcl
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
spithash
Master


Joined: 12 Jul 2007
Posts: 245
Location: DALnet, EFnet & Freenode

PostPosted: Wed Nov 05, 2014 2:11 pm    Post subject: Reply with quote

The script needs update again, I will try to contact Trixar_za. They changed the website layout again I guess
_________________
DALnet #CodeMasters - EFnet #eggtcl Nick: spithash
Click here for troll.tcl
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
Trixar_za
Op


Joined: 18 Nov 2009
Posts: 143
Location: South Africa

PostPosted: Thu Nov 06, 2014 2:53 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
spithash
Master


Joined: 12 Jul 2007
Posts: 245
Location: DALnet, EFnet & Freenode

PostPosted: Thu Nov 06, 2014 10:11 am    Post subject: Reply with quote

Thanks a lot man Very Happy
_________________
DALnet #CodeMasters - EFnet #eggtcl Nick: spithash
Click here for troll.tcl
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
Trixar_za
Op


Joined: 18 Nov 2009
Posts: 143
Location: South Africa

PostPosted: Sun Jun 28, 2015 12:15 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
spithash
Master


Joined: 12 Jul 2007
Posts: 245
Location: DALnet, EFnet & Freenode

PostPosted: Sat Jul 11, 2015 6:30 pm    Post subject: Reply with quote

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

_________________
DALnet #CodeMasters - EFnet #eggtcl Nick: spithash
Click here for troll.tcl
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases All times are GMT - 4 Hours
Goto page Previous  1, 2, 3, 4, 5, 6  Next
Page 5 of 6

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber