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

	<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-04-04T15:12:17-04:00</updated>

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

		<entry>
		<author><name><![CDATA[CrazyCat]]></name></author>
		<updated>2012-04-04T15:12:17-04:00</updated>

		<published>2012-04-04T15:12:17-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=99162#p99162</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=99162#p99162"/>
		<title type="html"><![CDATA[GTranslate is not working because of TCL issues]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=99162#p99162"><![CDATA[
A small message to say that gTranslator doesn't work anymore and will not be released again.<br>Google choosed to block the API v1 and the v2 is a commercial one, I refuse to make a script which use commercial services.<br><br>@slennox: could you please remove <a href="http://www.egghelp.org/cgi-bin/tcl_archive.tcl?mode=download&amp;id=1662" class="postlink">Google Translator</a> from the tcl archive ?<br><br>Regards,<br>CrazyCat<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=691">CrazyCat</a> — Wed Apr 04, 2012 3:12 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ujjain]]></name></author>
		<updated>2011-10-08T18:17:24-04:00</updated>

		<published>2011-10-08T18:17:24-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=97892#p97892</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=97892#p97892"/>
		<title type="html"><![CDATA[GTranslate is not working because of TCL issues]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=97892#p97892"><![CDATA[
I have new code, it works perfectly and is extremely light-weight and simple.<br><div class="codebox"><p>Code: </p><pre><code>administrator@artemis:~$ cat /home/administrator/eggdrop/scripts/gtranslate.tclnamespace eval gTranslator {# Factor this out into a helperproc getJson url {  set tok [http::geturl $url]  set res [json::json2dict [http::data $tok]]  http::cleanup $tok  return $res}# How to decode _decimal_ entities; WARNING: high magic factor within!proc decodeEntities str {  set str [string map {\[ {\[} \] {\]} \$ {\$} \\ \\\\} $str]  subst [regsub -all {&amp;#(\d+);} $str {[format %c \1]}]}bind pub - !tr gTranslator::translateproc translate { nick uhost handle chan text } {  package require http  package require json  set lngto [string tolower [lindex [split $text] 0]]  set text [http::formatQuery q [join [lrange [split $text] 1 end]]]  set dturl "http://ajax.googleapis.com/ajax/services/language/detect?v=1.0&amp;q=$text"  set lng [dict get [getJson $dturl] responseData language]  if { $lng == $lngto } {    putserv "PRIVMSG $chan :\002Error\002 translating $lng to $lngto."    return 0  }  set trurl "http://ajax.googleapis.com/ajax/services/language/translate?v=1.0&amp;langpair=$lng%7c$lngto&amp;$text"  putlog $trurl  set res [getJson $trurl]  putlog $res  #putserv "PRIVMSG $chan :Language detected: $lng"  set translated [decodeEntities [dict get $res responseData translatedText]]  putserv "PRIVMSG $chan :$translated"#  putserv "PRIVMSG $chan :[encoding convertto utf-8 $translated]"}}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11385">ujjain</a> — Sat Oct 08, 2011 6:17 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[rayvtirx]]></name></author>
		<updated>2011-10-08T11:52:04-04:00</updated>

		<published>2011-10-08T11:52:04-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=97891#p97891</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=97891#p97891"/>
		<title type="html"><![CDATA[GTranslate is not working because of TCL issues]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=97891#p97891"><![CDATA[
ah cool - thanks<br>ill wait until its on egghelp as.. i need a translator to go on that site  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_razz.gif" width="15" height="15" alt=":P" title="Razz"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11236">rayvtirx</a> — Sat Oct 08, 2011 11:52 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[CrazyCat]]></name></author>
		<updated>2011-10-08T11:34:00-04:00</updated>

		<published>2011-10-08T11:34:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=97889#p97889</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=97889#p97889"/>
		<title type="html"><![CDATA[GTranslate is not working because of TCL issues]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=97889#p97889"><![CDATA[
Oh ! I didn't notice the version on egghelp wasn't the last one I did.<br><br>The official download is <a href="http://www.eggdrop.fr/board/downloads.php?action=view&amp;did=209" class="postlink">http://www.eggdrop.fr/board/downloads.p ... ew&amp;did=209</a><br><br>I'll send the good version to slennox in a few hours.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=691">CrazyCat</a> — Sat Oct 08, 2011 11:34 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[rayvtirx]]></name></author>
		<updated>2011-10-08T10:44:35-04:00</updated>

		<published>2011-10-08T10:44:35-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=97888#p97888</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=97888#p97888"/>
		<title type="html"><![CDATA[GTranslate is not working because of TCL issues]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=97888#p97888"><![CDATA[
just happened to find a different version of the same script while googling and this one works <a href="http://heartbroken.bshellz.net/gtranslate.tcl" class="postlink">http://heartbroken.bshellz.net/gtranslate.tcl</a><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11236">rayvtirx</a> — Sat Oct 08, 2011 10:44 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[rayvtirx]]></name></author>
		<updated>2011-10-08T09:03:04-04:00</updated>

		<published>2011-10-08T09:03:04-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=97887#p97887</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=97887#p97887"/>
		<title type="html"><![CDATA[GTranslate is not working because of TCL issues]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=97887#p97887"><![CDATA[
ok got tcl 8.5 <br>now getting <br>Tcl error [gTranslator::translate]: Illegal characters in URL path<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11236">rayvtirx</a> — Sat Oct 08, 2011 9:03 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[CrazyCat]]></name></author>
		<updated>2011-10-08T08:13:19-04:00</updated>

		<published>2011-10-08T08:13:19-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=97885#p97885</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=97885#p97885"/>
		<title type="html"><![CDATA[GTranslate is not working because of TCL issues]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=97885#p97885"><![CDATA[
You need tcl 8.5.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=691">CrazyCat</a> — Sat Oct 08, 2011 8:13 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[rayvtirx]]></name></author>
		<updated>2011-10-08T02:22:39-04:00</updated>

		<published>2011-10-08T02:22:39-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=97884#p97884</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=97884#p97884"/>
		<title type="html"><![CDATA[GTranslate is not working because of TCL issues]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=97884#p97884"><![CDATA[
i get this error <br>Tcl error [gTranslator::translate]: can't find package dict<br>any ideas?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11236">rayvtirx</a> — Sat Oct 08, 2011 2:22 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ujjain]]></name></author>
		<updated>2010-11-25T10:31:45-04:00</updated>

		<published>2010-11-25T10:31:45-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=95194#p95194</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=95194#p95194"/>
		<title type="html"><![CDATA[GTranslate is not working because of TCL issues]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=95194#p95194"><![CDATA[
<blockquote class="uncited"><div>@speechies: I know my tcl isn't efficient, it was just an exercice to use the Google Translate API, and I didn't work alot about the language detection / translation.<br><br>BTW, I think I'll do a wonderfull version soon <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy"> Ok, let's say a better one <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"></div></blockquote>Do you have any idea how I can solve the Tcl error?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11385">ujjain</a> — Thu Nov 25, 2010 10:31 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[CrazyCat]]></name></author>
		<updated>2010-11-23T16:24:15-04:00</updated>

		<published>2010-11-23T16:24:15-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=95188#p95188</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=95188#p95188"/>
		<title type="html"><![CDATA[GTranslate is not working because of TCL issues]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=95188#p95188"><![CDATA[
@speechies: I know my tcl isn't efficient, it was just an exercice to use the Google Translate API, and I didn't work alot about the language detection / translation.<br><br>BTW, I think I'll do a wonderfull version soon <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy"> Ok, let's say a better one <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=691">CrazyCat</a> — Tue Nov 23, 2010 4:24 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ujjain]]></name></author>
		<updated>2010-11-20T15:27:50-04:00</updated>

		<published>2010-11-20T15:27:50-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=95151#p95151</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=95151#p95151"/>
		<title type="html"><![CDATA[GTranslate is not working because of TCL issues]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=95151#p95151"><![CDATA[
You might have a point, although it might take me much time to scrap the other features from that script. I have another script that does almost all Google functions, but it is was used spamishly in our language channel. Our channel is about learning languages and I prefer a bot with little functionality, Google Translate. Converting the syntax from !tr fr|to text might also be hard to do for me.<br><br>The current script is working fine and as long as there are no security issues, I am fine with the functionality. Replacing the translate-script by a fully functional Google script is not an option, we have a language channel with 50 users and having them use locate, wikipedia, whois, news functions in our channel will reduce the quality of our channel.<br><br>I appreciate your suggestion and will consider taking the translate part of that script as it might work.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11385">ujjain</a> — Sat Nov 20, 2010 3:27 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[speechles]]></name></author>
		<updated>2010-11-20T14:06:06-04:00</updated>

		<published>2010-11-20T14:06:06-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=95148#p95148</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=95148#p95148"/>
		<title type="html"><![CDATA[GTranslate is not working because of TCL issues]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=95148#p95148"><![CDATA[
<blockquote class="uncited"><div>There is no language limitation in place. I changed the comparization in source code to -10, effectively killing the language limit:<div class="codebox"><p>Code: </p><pre><code>if { [lsearch $::gTranslator::lngs $lngto] == -10 } { </code></pre></div>This effectively ends any relevance of lngs. I will rewrite the entire TCL-script when I have time, but it works perfectly fine as lngs is no longer used. I am aware I can remove both set lngs...  including the entire if-statement. <br><br>I have been looking for 2 weeks for a way to get the tcl-script working on the eggdrop installed on the CentOS-VM. Do you have any idea's how to achieve this?</div></blockquote>Not to hi-jack this thead, but at the moment <a href="http://forum.egghelp.org/viewtopic.php?t=13586" class="postlink">this script</a> has the functionality your looking for and works if patched for utf-8 support both input and output. Uses the same !tr trigger as well. It is a full featured script with functionality far beyond translations. Some features presently are broken, this is due to the nature of it being based on html rather than api. These will be fixed eventually, but the core functions are solid themselves it's merely the parsers that break.<br><br>Now about this script, it has potential easily to rival my mere scraping attempt as it uses pure API. It will not require maintenance for parsing as it is fed a json reply which can be easily machine read. My html parsing version its meant to be read by humans, and it's context and style will change as humans evolve. So my script will break over time. But for the moment, see if perhaps it works for you. It may not, it will likely suffer same error. It may not, can't know without trying. Hopefully CrazyCat evolves this script into something closely resembling mine, but with the added benefit of the API wrapping.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8138">speechles</a> — Sat Nov 20, 2010 2:06 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ujjain]]></name></author>
		<updated>2010-11-20T13:40:31-04:00</updated>

		<published>2010-11-20T13:40:31-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=95147#p95147</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=95147#p95147"/>
		<title type="html"><![CDATA[GTranslate is not working because of TCL issues]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=95147#p95147"><![CDATA[
There is no language limitation in place. I changed the comparization in source code to -10, effectively killing the language limit:<div class="codebox"><p>Code: </p><pre><code>if { [lsearch $::gTranslator::lngs $lngto] == -10 } { </code></pre></div>This effectively ends any relevance of lngs. I will rewrite the entire TCL-script when I have time, but it works perfectly fine as lngs is no longer used. I am aware I can remove both set lngs...  including the entire if-statement. <br><br>I have been looking for 2 weeks for a way to get the tcl-script working on the eggdrop installed on the CentOS-VM. Do you have any idea's how to achieve this?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11385">ujjain</a> — Sat Nov 20, 2010 1:40 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[speechles]]></name></author>
		<updated>2010-11-20T12:03:44-04:00</updated>

		<published>2010-11-20T12:03:44-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=95146#p95146</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=95146#p95146"/>
		<title type="html"><![CDATA[GTranslate is not working because of TCL issues]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=95146#p95146"><![CDATA[
@CrazyCat ... Why is this line there at all:<div class="codebox"><p>Code: </p><pre><code>set lngs { "fr" "en" "es" "de" "it" "nl" "tr" } </code></pre></div>Your Google translate script converts between a massive 7 language pairs? Wow, very not impressed at all. To add languages people need to constantly tamper with that variable.. Why?<br><br>The Google translate script I have which is part of Incith:Google doesn't limit you, want to translate Serbian to Japanese it will.<br><br># auto detect serbian to japanese<br>!tr @ja &lt;serbian text goes here&gt;<br><br># auto detect japanese back to serbian<br>!tr @sr &lt;the japanese text given back in response above&gt;<br><br># force chinese detection and return japanese<br>!tr zh-cn@ja &lt;chinese text here&gt;<br><br># force french detection and return default english reply<br>!tr fr@ &lt;french text here&gt;<br><br># auto-detect and return default english reply<br># fully auto, no languages required.<br>!tr &lt;any language at all goes here&gt;<br><br>Google will auto-detect you've used Serbian and convert it properly to Japanese. There is no limit to the languages you can use in mine as evidenced above. If Google supports it, you will be given the translation. If Google doesn't support it _yet_, you will be given that message. If it isn't a valid language, you will get back your original text. Yours doesn't work like this and limits itself for no reason. You should check out of the translate portion of the Google script and COPY the way I do it exactly. Otherwise, your script will always be inferior even though it should be superior using the API rather than web-scraping.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8138">speechles</a> — Sat Nov 20, 2010 12:03 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ujjain]]></name></author>
		<updated>2010-11-20T11:47:11-04:00</updated>

		<published>2010-11-20T11:47:11-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=95145#p95145</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=95145#p95145"/>
		<title type="html"><![CDATA[GTranslate is not working because of TCL issues]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=95145#p95145"><![CDATA[
<blockquote class="uncited"><div>Well, I'll have a look on this trouble.<br>I'm using Debian, so it might be hard to reproduce the trouble, but I'll find the solution <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"></div></blockquote>Thank you. If you wish to access my CentOS VM, that's no problem.<br><blockquote class="uncited"><div><div class="codebox"><p>Code: </p><pre><code>set text [::http::formatQuery q [join [lrange [split $text] 1 end]]]set dturl "http://ajax.googleapis.com/ajax/services/language/detect?v=1.0&amp;q=$text"</code></pre></div>This looks wrong. q= is .. already going to be part of $text when that first line runs. This is what using [::http::formatQuery] does. It will be "q=text user put minus first word" ... then you add q= agan to it within your "set dturl" line. Why? Google has a very forgiving API if it works like that.<br><br>There is nothing wrong as far as that users error goes. [::http::formatQuery] .. or simply [http::formatQuery] should both work exactly the same and not cause that issue. The problem more than likely is  ( I replaced http.tcl (renamed old version) and restarted the entire VM to be completely certain it would not do anything with the http.tcl )<br><br>So wait, its an eggdrop running inside a virtual machine? was it compiled on that virtual machine so paths and everything work that way. It won't out of the box, it will fail to load packages (or use the wrong path and the wrong http.tcl) just as your seeing now.</div></blockquote>Not sure I understand what you mean regarding the setting of variables, but it works on the Ubuntu desktop.<div class="codebox"><p>Code: </p><pre><code>[16:38:43] http://ajax.googleapis.com/ajax/services/language/translate?v=1.0&amp;langpair=fr%7cnl&amp;q=Je%20deteste%20de%20la%20fromage.[16:38:44] responseData {translatedText {Ik haat de kaas.}} responseDetails null responseStatus 200[16:38:44] http://ajax.googleapis.com/ajax/services/language/translate?v=1.0&amp;langpair=fr%7cnl&amp;q=Je%20deteste%20fromage.[16:38:44] responseData {translatedText {Ik haat kaas.}} responseDetails null responseStatus 200[16:38:44] http://ajax.googleapis.com/ajax/services/language/translate?v=1.0&amp;langpair=fr%7cnl&amp;q=J%c2%b4aime%20bien%20fromage.[16:38:44] responseData {translatedText {Ik hou van kaas.}} responseDetails null responseStatus 200</code></pre></div>Eggdrop has been installed on both a CentOS- and Ubuntu-VM and compiling went perfectly fine. Installing Eggdrop on a physical machine or virtual machine should make no difference.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11385">ujjain</a> — Sat Nov 20, 2010 11:47 am</p><hr />
]]></content>
	</entry>
	</feed>
