<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://forum.eggheads.org/app.php/feed/topic/18097" />

	<title>egghelp/eggheads community</title>
	<subtitle>Discussion of eggdrop bots, shell accounts and tcl scripts.</subtitle>
	<link href="https://forum.eggheads.org/index.php" />
	<updated>2012-10-07T15:59:47-04:00</updated>

	<author><name><![CDATA[egghelp/eggheads community]]></name></author>
	<id>https://forum.eggheads.org/app.php/feed/topic/18097</id>

		<entry>
		<author><name><![CDATA[anotheruser]]></name></author>
		<updated>2012-10-07T15:59:47-04:00</updated>

		<published>2012-10-07T15:59:47-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=100108#p100108</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=100108#p100108"/>
		<title type="html"><![CDATA[urban.tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=100108#p100108"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>bind pub - !ud udproc ud {nick host hand chan arg} {package require http        set arg [string map { " " "+" } $arg]  puts $arg  if {[string length $arg] != 0 } { set url "http://www.urbandictionary.com/define.php?term=$arg"  } else {    set url "http://www.urbandictionary.com/random.php"    set page [http::data [http::geturl $url]]    regexp {href="(.*?)"} $page =&gt; url  }  set page [http::data [http::geturl $url]]  regexp {'word'&gt;(.*?)&lt;\/td&gt;} $page =&gt; word  regexp {definition"&gt;(.*?)(&lt;br\/&gt;|&lt;\/div&gt;)} $page =&gt; deff  regexp {author"&gt;(.*?)&lt;\/a&gt;} $page =&gt; author  regexp {example"&gt;(.*?)&lt;/div&gt;} $page =&gt; example  regexp {'not_defined_yet'&gt;} $page =&gt; notfound  set deff [string map {" ""} $deff]  set example [string map {" "\""} $example]  regsub -all {(&lt;.*?&gt;)} $example "" example  if {[info exists deff]} {    putserv "PRIVMSG $chan :Word: [string trim $word]"    putserv "PRIVMSG $chan :Definition: [string trim $deff]"      if {[info exists example]} { putserv "PRIVMSG $chan :Example: [string trim $example]" }    putserv "PRIVMSG $chan :By: ([string trim $author]) Link: $url"  }}putlog "Urban Dictionary"</code></pre></div>For those still looking here is a working update<br>Source: <a href="http://www.hawkee.com/snippet/9545/" class="postlink">http://www.hawkee.com/snippet/9545/</a><br><br>This is not my work but thanks to the original poster/writer<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6729">anotheruser</a> — Sun Oct 07, 2012 3:59 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Trixar_za]]></name></author>
		<updated>2010-11-01T19:44:17-04:00</updated>

		<published>2010-11-01T19:44:17-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=94954#p94954</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=94954#p94954"/>
		<title type="html"><![CDATA[urban.tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=94954#p94954"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code># Urban Dictionary Script by Trixar_za# Based on the Twitter script by Warlord v1.0# Type in partyline: ".chanset #channel +urban" to enable it.# Sets the logoset urban(logo) "\002\[UD\]:\002"# Sets the user agentset urban(agent) "Mozilla/4.75 (X11; U; Linux 2.2.17; i586; Nav)"setudef flag urbanif {[catch {package require http 2.5} e] != 0} {  set urban(noutf8) 1  package require http}bind pub - !urban proc:urbanbind pub - .urban proc:urbanbind pub - !ud proc:urbanbind pub - .ud proc:urban# wordwrap code by speechlessproc msg {type dest data} {   set len [expr {500-[string len ":$::botname $type $dest :\r\n"]}]   foreach line [wordwrap $data $len] {      putserv "$type $dest :$line"   }}proc wordwrap {data len} {   set out {}   foreach line [split [string trim $data] \n] {      set curr {}      set i 0      foreach word [split [string trim $line]] {         if {[incr i [string len $word]]&gt;$len} {            lappend out [join $curr]            set curr [list $word]            set i [string len $word]         } {            lappend curr $word         }         incr i      }      if {[llength $curr]} {         lappend out [join $curr]      }   }   set out} proc proc:urban {nick uhand handle chan input} {  if {[channel get $chan urban]} {     global urban    if {![llength [split $input]]} {       msg "PRIVMSG" $chan "$urban(logo) Please be more specific. Ex: !urban word"    } else {       putquick "PRIVMSG $chan :$urban(logo) Getting defintion for $input..."         if {[info exists urban(noutf8)]} {          set http [::http::config -useragent $urban(agent)]       } else {          set http [::http::config -useragent $urban(agent) -urlencoding "utf-8"]       }       foreach word [split $input] {          lappend query [lindex [split [http::formatQuery a $word] =] 1]       }       catch { set http [::http::geturl "http://www.urbandictionary.com/define.php?term=[join $query %20]" -timeout 10000]} error        if {![string match -nocase "::http::*" $error]} {          msg "PRIVMSG" $chan "$urban(logo) [string totitle [string map {"\n" " | "} $error]] \( $query \)"          return 0       }       if {![string equal -nocase [::http::status $http] "ok"]} {          msg "PRIVMSG" $chan "$urban(logo) [string totitle [::http::status $http]] \( $query \)"          return 0       }       set html [::http::data $http]       # Clean up :P       regsub -all {\n} $html { } html       regsub -all {\t} $html { } html       regsub -all {&lt;br/&gt;} $html { } html       regsub -all { } $html { } html       regsub -all {    } $html { } html       regsub -all {   } $html { } html       regsub -all {  } $html { } html       regsub -all {&lt;a.+?&gt;} $html {} html       regsub -all {&lt;/a&gt;} $html {} html       regsub -all {&lt;strong.+?&gt;} $html {} html       regsub -all {&lt;/strong&gt;} $html {} html       regsub -all {—} $html {-} html       regsub -all {&gt;} $html {&gt;} html       regsub -all {&lt;} $html {&lt;} html       regsub -all {&amp;} $html {\&amp;} html       regsub -all {×} $html {*} html       regsub -all {(?:\x91|\x92|’|‘|')} $html {'} html       regsub -all {(?:\x93|\x94|“|”|")} $html {"} html       regsub -all {×} $html {x} html       regsub -all {(?:&lt;!\[CDATA\[)} $html {} html       if {[regexp -- {&lt;div class="definition"&gt;(.+?)&lt;/div&gt;} $html - uddef]} {          set uddef [string trim $uddef]       }       if {[regexp -- {&lt;div class="example"&gt;&lt;/div&gt;} $html - -]} {          set uddex "None"       } elseif {[regexp -- {&lt;div class="example"&gt;(.+?)&lt;/div&gt;} $html - uddex] &amp;&amp; $uddex != "None"} {          set uddex [string trim $uddex]       }       if {[info exists uddef]} {          msg "PRIVMSG" $chan "$urban(logo) \002Definition:\002 $uddef"          if {$uddex != "None"} {             msg "PRIVMSG" $chan "$urban(logo) \002Example:\002 $uddex"          }       } else {          msg "PRIVMSG" $chan "$urban(logo) Word not found or doesn't exist."       }    }  }}putlog "Urban Dictionary Script by Trixar_za Loaded"</code></pre></div>I'm still trying to fix my website. The IP got changed without notice and I only realised it now...<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10958">Trixar_za</a> — Mon Nov 01, 2010 7:44 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anahel]]></name></author>
		<updated>2010-10-31T10:14:35-04:00</updated>

		<published>2010-10-31T10:14:35-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=94935#p94935</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=94935#p94935"/>
		<title type="html"><![CDATA[urban.tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=94935#p94935"><![CDATA[
could you post fixed code?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10737">Anahel</a> — Sun Oct 31, 2010 10:14 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Trixar_za]]></name></author>
		<updated>2010-10-30T18:29:45-04:00</updated>

		<published>2010-10-30T18:29:45-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=94929#p94929</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=94929#p94929"/>
		<title type="html"><![CDATA[urban.tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=94929#p94929"><![CDATA[
Thank you for the fix - It's updated on the website now too <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10958">Trixar_za</a> — Sat Oct 30, 2010 6:29 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[starryeyedhaze]]></name></author>
		<updated>2010-10-29T14:49:54-04:00</updated>

		<published>2010-10-29T14:49:54-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=94907#p94907</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=94907#p94907"/>
		<title type="html"><![CDATA[nevermind.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=94907#p94907"><![CDATA[
It looks like urban dictionary changed their single quotes to double quotes. All fixed <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11408">starryeyedhaze</a> — Fri Oct 29, 2010 2:49 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[starryeyedhaze]]></name></author>
		<updated>2010-10-29T14:47:24-04:00</updated>

		<published>2010-10-29T14:47:24-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=94906#p94906</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=94906#p94906"/>
		<title type="html"><![CDATA[urban.tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=94906#p94906"><![CDATA[
I'm stumped. Today the urban dictionary script stopped working. It doesn't look like UD changed their formatting or anything and the regexes in the tcl look fine.<br><br><br>[UD]: Getting defintion for vagina...<br>[UD]: Word not found or doesn't exist.<br><br>I get this error every time no matter what word I choose. I have tested that I can get to UD from my bot's host... just confused. Can anybody help?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11408">starryeyedhaze</a> — Fri Oct 29, 2010 2:47 pm</p><hr />
]]></content>
	</entry>
	</feed>
