<?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/16672" />

	<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>2011-01-10T16:13:26-04:00</updated>

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

		<entry>
		<author><name><![CDATA[spithash]]></name></author>
		<updated>2011-01-10T16:13:26-04:00</updated>

		<published>2011-01-10T16:13:26-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=95615#p95615</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=95615#p95615"/>
		<title type="html"><![CDATA[A simple tcl to pull a word origin from etymonline.com]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=95615#p95615"><![CDATA[
This script is just <strong class="text-strong">awesome</strong>  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy">  <br><br>I tweaked it a little bit to suit my needs and it's just GREAT <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>Thanks Arfer <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=9145">spithash</a> — Mon Jan 10, 2011 4:13 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[arfer]]></name></author>
		<updated>2009-03-08T20:15:41-04:00</updated>

		<published>2009-03-08T20:15:41-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=87780#p87780</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=87780#p87780"/>
		<title type="html"><![CDATA[A simple tcl to pull a word origin from etymonline.com]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=87780#p87780"><![CDATA[
Nope, the script uses http.tcl<br><br>You would get an error from the line 'package require http' if it wasn't available.<br><br>Did you read my last post? Colour?? Characters ??<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5705">arfer</a> — Sun Mar 08, 2009 8:15 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[manipulativeJack]]></name></author>
		<updated>2009-03-08T20:05:46-04:00</updated>

		<published>2009-03-08T20:05:46-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=87779#p87779</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=87779#p87779"/>
		<title type="html"><![CDATA[A simple tcl to pull a word origin from etymonline.com]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=87779#p87779"><![CDATA[
Hmm, I am not sure what I am doing wrong.<br><br>I still get the same thing, just the URL displaying.<br><br>My admin said he is using the newest version of TCL and I am not seeing any partyline errors. (I am not sure how to check the TCL version myself.)<br><br>I am using egghttp.tcl - is that what you use?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10503">manipulativeJack</a> — Sun Mar 08, 2009 8:05 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[arfer]]></name></author>
		<updated>2009-03-08T18:53:35-04:00</updated>

		<published>2009-03-08T18:53:35-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=87777#p87777</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=87777#p87777"/>
		<title type="html"><![CDATA[A simple tcl to pull a word origin from etymonline.com]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=87777#p87777"><![CDATA[
You might be right. They aren't wrapped on my screen but I'm at a high resolution.<br><br><a href="http://www.nomorepasting.com/getpaste.php?pasteid=24822" class="postlink">http://www.nomorepasting.com/getpaste.php?pasteid=24822</a><br><br>Try that one, though I doubt if the text box on this forum adds line breaks.<br><br>You might want to try a windows based editor (assuming you use windows) and then ftp upload the script. Command line editors are pretty basic by comparison.<br><br>One other very important thing. If you exceed the characters allowed on your network OR the channel doesnt allow text embellishment (+c on DALnet) then in either case there will be no output at all. I say this because the URL line is not in colour and has relatively few characters. You do see that line. My 50 pence each way is on this being the problem.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5705">arfer</a> — Sun Mar 08, 2009 6:53 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[manipulativeJack]]></name></author>
		<updated>2009-03-08T18:44:09-04:00</updated>

		<published>2009-03-08T18:44:09-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=87776#p87776</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=87776#p87776"/>
		<title type="html"><![CDATA[A simple tcl to pull a word origin from etymonline.com]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=87776#p87776"><![CDATA[
Well, I was just copying what was displayed on the forum screen here and  pasting it into the editor on my shell (pico/nano) it does not wrap lines but it looks like they are wrapped here on the forum ... unless I am just seeing things wrong?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10503">manipulativeJack</a> — Sun Mar 08, 2009 6:44 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[arfer]]></name></author>
		<updated>2009-03-08T18:16:32-04:00</updated>

		<published>2009-03-08T18:16:32-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=87775#p87775</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=87775#p87775"/>
		<title type="html"><![CDATA[A simple tcl to pull a word origin from etymonline.com]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=87775#p87775"><![CDATA[
You really should use a decent quality text editor that won't wrap lines. Random line breaks in the script will make a mess for sure.<br><br>If you definitely had spurious line breaks, scrap it and start again. Don't 'play' with it.<br><br>Editpad Lite seems OK and is free.<br><br>I use ActiveState's Komodo Edit mostly (also free) because it checks syntax as I'm coding, though the current version requires the Tcl Linter to be installed separately which isn't exactly intuitively easy.<br><br>One other thing to check is your Tcl version. It should be 8.4+. I don't think 8.3 will correctly interpret the regsub commands I'm using. However, such an event would yield a partyline Tcl error.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5705">arfer</a> — Sun Mar 08, 2009 6:16 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[manipulativeJack]]></name></author>
		<updated>2009-03-08T18:04:04-04:00</updated>

		<published>2009-03-08T18:04:04-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=87774#p87774</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=87774#p87774"/>
		<title type="html"><![CDATA[A simple tcl to pull a word origin from etymonline.com]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=87774#p87774"><![CDATA[
Oh, _so_ nice.<br><br>It looks perfect in your screen shot, _exactly_ what I was thinking.<br><br>However when I try to implement it myself it is giving me some problems - when I copy and paste it it looks like some of the lines have wrapped - I went in and tried to make it look right again but for some reason when I type:<br><br>!etymology cat<br><br>I just get the URL<br><br>&lt;Jack&gt; !etymology cat<br>&lt;MyBot&gt; <a href="http://www.etymonline.com/index.php?search=cat" class="postlink">http://www.etymonline.com/index.php?search=cat</a><br><br>I will keep playing with it and let you know if I get it right - I am SURE it is something I did on my end (with the pasting) because it looks perfect in your screenshot.<br><br>Thanks in advance.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10503">manipulativeJack</a> — Sun Mar 08, 2009 6:04 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[arfer]]></name></author>
		<updated>2009-03-08T17:22:49-04:00</updated>

		<published>2009-03-08T17:22:49-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=87772#p87772</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=87772#p87772"/>
		<title type="html"><![CDATA[A simple tcl to pull a word origin from etymonline.com]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=87772#p87772"><![CDATA[
Difficult to know how to deal with the html without knowing all the possible tags that are returned. Anyway, lets call this a first effort.<br><br>Only deals with a single word. You didn't say if you ever put phrases in.<br><br>In the partyline, requires .chanset #channelname +etymology<br><br>Requires Tcl 8.4+ (anything less probably won't deal correctly with the regsub commands)<br><br>Requires text embellishments (colour) to be allowed in the channel<br><br>vEtymologyMaxWords is the number of words from the html response that will appear in the channel output. The total number of characters in these words MUST be less than that permitted in a single output for the network you are on. I have assumed around 7 characters per word x the configured value of 40 words = 280 (this is considerably less than the max character output permitted on DALnet).<br><div class="codebox"><p>Code: </p><pre><code>set vEtymologyMaxWords 40package require httpsetudef flag etymologyset vEtymologyTimeout 10set vEtymologyUrl http://www.etymonline.com/index.phpbind PUB - !etymology pEtymologySearchproc pEtymologySearch {nick uhost hand channel txt} {  global vEtymologyTimeout vEtymologyUrl vEtymologyMaxWords  if {[channel get $channel etymology]} {    set arguments [string trim $txt]    if {[llength [split $arguments]] == 1} {      set agent [::http::config -useragent "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)"]      if {![catch {set http [::http::geturl $vEtymologyUrl\?search=$txt -timeout [expr {$vEtymologyTimeout * 1000}]]}]} {        switch -- [::http::status $http] {          "timeout" {putserv "PRIVMSG $channel :attempt to scrape $vEtymologyUrl timed out after $vEtymologyTimeout seconds"}          "error" {putserv "PRIVMSG $channel :attempt to scrape $vEtymologyUrl returned error [::http::error $http]"}          "ok" {            switch -- [::http::ncode $http] {              200 {                regexp -- {&lt;dd class=\"highlight\"&gt;(.+?)&lt;/dd&gt;} [::http::data $http] -&gt; data                if {[info exists data]} {                  set data [regsub -all -- {&lt;span class=\"foreign\"&gt;([^&lt;]*?)&lt;/span&gt;} $data "\00305\\1\003"]                  set data [regsub -all -- {\(see.*&lt;a href=\"/index\.php([^"]*?)\".*\)} $data "\[see \00312$vEtymologyUrl\\1\003\]" ]                  set data [regsub -all -- {\(([^)]*?)\)} $data \(\00314\\1\003\)]                  set char \00303[encoding convertto utf-8 \u25CF]\003                  set data "\00304$txt\003 [join [lrange [split $data] 0 [expr {$vEtymologyMaxWords - 1}]]] [string repeat $char 5]"                  putserv "PRIVMSG $channel :$data"                  putserv "PRIVMSG $channel :$vEtymologyUrl\?search=$txt"                } else {putserv "PRIVMSG $channel :$txt not found at $vEtymologyUrl"}              }              default {putserv "PRIVMSG $channel :attempt to scrape $vEtymologyUrl returned ncode [::http::ncode $http]"}            }          }        }        ::http::cleanup $http      } else {putserv "PRIVMSG $channel :attempted connection to $vEtymologyUrl failed"}    } else {putserv "PRIVMSG $channel :correct syntax is !etymology &lt;word&gt;"}  }  return 0 }</code></pre></div><img src="http://i672.photobucket.com/albums/vv90/arfer/etymology-1.png" class="postimage" alt="Image"><br><br>Don't you just love colours!! WHOOPEE!!!<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5705">arfer</a> — Sun Mar 08, 2009 5:22 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[manipulativeJack]]></name></author>
		<updated>2009-03-05T00:19:16-04:00</updated>

		<published>2009-03-05T00:19:16-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=87708#p87708</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=87708#p87708"/>
		<title type="html"><![CDATA[A simple tcl to pull a word origin from etymonline.com]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=87708#p87708"><![CDATA[
My channel often discusses the meaning of words and where the word<br>comes from, I refer to <a href="http://www.etymonline.com" class="postlink">www.etymonline.com</a> daily and was thinking it<br>would be great to have a script to offer the word origin information:<br><br><br>&lt;Jack&gt;!origin cat<br>&lt;Bot&gt; <strong class="text-strong">cat</strong> O.E. (c.700), from W.Gmc. (c.400-450), from P.Gmc. *kattuz, from L.L. cattus. The near-universal European word now, it appeared in Europe as L. catta (Martial, c.75 C.E.), Byzantine Gk. katta (c.350) and was in general use on the continent by c. 700, replacing L. feles. Probably ult. Afro-Asiatic (cf. Nubian kadis, Berber kadiska, both meaning "cat"). Ar. qitt "tomcat" may be from the same source. Cats were domestic in Egypt from c.2000 B.C.E., but not a familiar household animal to classical Greeks and Romans. The nine lives have been proverbial since at least c.1562. Extended to lions, tigers, etc. 1607. As a term of contempt for a woman, from c.1225. Slang sense of "prostitute" is from at least 1401. Slang sense of "fellow, guy," is from 1920, originally in U.S. Black Eng.; narrower sense of "jazz enthusiast" is recorded from 1931. Catcall first recorded 1659; catnap is from 1823; catfish is from 1620; catwalk is from 1917. Cat's-cradle is from 1768. Cat-o'-nine-tails (1695), probably so called in reference to its "claws," was legal instrument of punishment in British Navy until 1881. Cat's paw (1769, but cat's foot in the same sense, 1597) refers to old folk tale in which the monkey tricks the cat into pawing chestnuts from a fire; the monkey gets the nuts, the cat gets a burnt paw. To rain cats and dogs (c.1652) is probably an extension of cats and dogs as proverbial for "strife, enmity" (1579). Cat-witted "small-minded, obstinate, and spiteful" (1673) deserved to survive. For Cat's meow, cat's pajamas, see bee's knees. <br><br><br>...and maybe some kind of option to determine how much text it will spam, so you could have it only do two or three lines worth and then have it followed by Visit <a href="http://www.etymonline.com/index.php?search=cat&amp;searchmode=none" class="postlink">http://www.etymonline.com/index.php?sea ... hmode=none</a> for the full info!<br><br>If no one seems interested I will keep giving it a try on my own, but advice would be great also! Thanks!<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10503">manipulativeJack</a> — Thu Mar 05, 2009 12:19 am</p><hr />
]]></content>
	</entry>
	</feed>
