This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

UNOFFICIAL incith-google 2.1x (Nov30,2o12)

Support & discussion of released scripts, and announcements of new releases.
Post Reply
M
MellowB
Voice
Posts: 24
Joined: Wed Jan 23, 2008 6:02 am
Location: Germany
Contact:

Post by MellowB »

Did !yt stop working or is my host now blocked or something like that? :>
Getting this on a YouTube request:

Code: Select all

<Cocco> [17:00] Tcl error [incith::google::private_message]: can't read "reply": no such variable
On the keyboard of life, always keep one finger on the ESC key.
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

MellowB wrote:Did !yt stop working or is my host now blocked or something like that? :>
Getting this on a YouTube request:

Code: Select all

<Cocco> [17:00] Tcl error [incith::google::private_message]: can't read "reply": no such variable
Yep, appears for certain domains Youtube is acquiring the actual country domain. So es.youtube.com redirects to youtube.es now at least as far as searching goes. I've coded a new routine into the fetch_html procedure which follows the first redirect given to solve it. I'll fix ebay soon, as the new server isn't entirely enabled yet. So expect some trouble with ebay at times. I will also change the way wiki(pedia/media) handles redirects which presently does it rather tediously, it can be neatened up using the way i've done it within the fetch_html... But anyways, the new script can be found right here or the first post of this thread. ;)

As far as making a separate version to support the utf-8 hack, this is possible. But I would rather first fix the script to full functionality and once this is achieved I can easily strip out my encoding modifications to return the script back to the utf-8 soup it started off as...Also noticed the original script does some encoding play within the input sections that I haven't pondered yet. Perhaps this code is what is ruining my input_encoding procedures?

Code: Select all

        if {[encoding system] != "identity" && [lsearch [encoding names] "ascii"]} {
          set command_char [encoding convertfrom ascii ${incith::google::command_char}]
          set input [encoding convertfrom ascii $input]
Perhaps the "ascii" and ascii should be changed into "utf-8" and utf-8? Then with encoding_conversion enabled possibly it can work?
M
MellowB
Voice
Posts: 24
Joined: Wed Jan 23, 2008 6:02 am
Location: Germany
Contact:

Post by MellowB »

Thanks for the quick youtube fix, works nice as usual again!
speechles wrote: As far as making a separate version to support the utf-8 hack, this is possible. But I would rather first fix the script to full functionality and once this is achieved I can easily strip out my encoding modifications to return the script back to the utf-8 soup it started off as...Also noticed the original script does some encoding play within the input sections that I haven't pondered yet. Perhaps this code is what is ruining my input_encoding procedures?

Code: Select all

        if {[encoding system] != "identity" && [lsearch [encoding names] "ascii"]} {
          set command_char [encoding convertfrom ascii ${incith::google::command_char}]
          set input [encoding convertfrom ascii $input]
Perhaps the "ascii" and ascii should be changed into "utf-8" and utf-8? Then with encoding_conversion enabled possibly it can work?
Good to hear that about the vanilla UTF-8 version, I'll wait for that! :)
Also I gave that idea of yours a try there but no luck with that, changing those two parts to utf-8 doesn't change anything. The bot still only reads garbage from the channel when it comes to UTF-8 encoded japanese for example. As said, with the fixed bot it actually READS it correctly from the channel (I see the correct input in the DCC chat window to the bot) but it gets butchered somewhere in the script. So yeah, currently the reading is not a problem with the script I'd say (I doubt that it can convert that garbage that it reads into anything useful anyway) but more with the bot itself. Only the code hack for the eggdrop can fix this.
On the keyboard of life, always keep one finger on the ESC key.
t
testebr
Halfop
Posts: 86
Joined: Thu Dec 01, 2005 12:22 pm

Post by testebr »

incith-google-v1.98p.tcl

[21:40:56] <!me> !ebay hd 4870
[21:40:58] <!Bot> 67 items found for '<H1><a onclick="vjo.darwin.domain.finding.dlg.DlgLink.onClick("M6NDlgLinkSvc", {"url":"http:/

oops after five minutes work fine:

[21:42:17] <!Bot> 67 Auctions | *NEW*Alienware Area-51 7500 Q9300 HD 487, $1,899.99/$1,999.99(Calculate), 0 Bids/Buy It Now, 1h 18m @ http://cgi.ebay.com/_W0QQItemZ250271594547 | NEW VisionTek Radeon HD 4870 512MB GDDR5, $284.99(Free), Buy It Now, 2h 53m @ http://cgi.ebay.com/_W0QQItemZ170243254989 | NEW Sapphire Radeon HD 4870 512MB GDDR5, $295.99(Free), Buy It Now, 12h 58m @
[21:42:18] <!Bot> http://cgi.ebay.com/_W0QQItemZ170243367989

Sorry for this useless post.
J
Jonathan1683
Voice
Posts: 10
Joined: Tue Jul 29, 2008 10:28 pm

Post by Jonathan1683 »

still getting this error

Code: Select all

[22:23] Tcl error [incith::google::public_message]: Unknown option -urlencoding, must be: -accept, -proxyfilter, -proxyhost, -proxyport, -useragent
I have http2.5
P
Phyxion
Voice
Posts: 7
Joined: Wed Jul 30, 2008 7:25 am

Post by Phyxion »

Thanks for this great script!

DailyMotion is broken in all builds you posted. Seems they updated their code.

Greetings.
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

Phyxion wrote:Thanks for this great script!

DailyMotion is broken in all builds you posted. Seems they updated their code.

Greetings.
DOH! :cry:

Code: Select all

    # set this to the default country you would like dailymotion to use when
    # no country is specified. default is "en" for international.
    # http://dailymotion.com/*/ - en, es, fr, nl, pt, da, el, it, pl, ro, sv, tr, ja, ko, zh, these are examples.
    # ------
    variable daily_country "en" 
This is the new config setting, because now dailymotion will allow the same flexibility as the rest of the script. The beauty of the country switch ;). Below is a sample of how this appears internationally and refined.
<speechles> !dm .en irc
<sp33chy> DailyMotion | Basshunter Boten Anna (03:25 eng 27 months ago - 361 votes) @ http://www.dailymotion.com/en/video/x5lmt | Ypres Westhoek Rally IRC (06:00 eng 14 months ago - 4 votes) @ http://www.dailymotion.com/en/video/x2e9c1 | Best of 2008 première partie by JM (10:25 fra yesterday - 5 votes) @
<sp33chy> http://www.dailymotion.com/en/video/x6a4lo | Basshunter Boten Anna [Fr] (03:25 fra 27 months ago - 403 votes) @ http://www.dailymotion.com/en/video/x5rna
<speechles> !dm .de irc
<sp33chy> DailyMotion | Basshunter Boten Anna French (03:25 fra 19 months ago - 4 votes) @ http://www.dailymotion.com/de/video/x13np3 | Jumpstyle (02:29 eng 6 months ago - 0 votes) @ http://www.dailymotion.com/de/video/x4a92o
<speechles> !dm .nl irc
<sp33chy> DailyMotion | Guide to IRC (03:10 nld 17 months ago - 0 votes) @ http://www.dailymotion.com/nl/video/x1m9en
Now it looks elegant again.. yay!! Get the new script here or this first post of this thread. As always, have a fun :P

Note: Also added some sweetness into google translations which should alleviate problems with translation pairs. It can now automatically detect what language you are translating from as exampled below. The same addition is included in the above link and same link on first post.
<speechles> !tr auto@en betul
<sp33chy> Google error: (auto->en) We are not yet able to translate from Malay into English..
<speechles> !tr auto@nl eggdrops are fun!
<sp33chy> Google says: (auto->nl) Translation: English (automatically detected) » Dutch >> Eggdrops zijn leuk!
<speechles> !tr auto@de sometimes eggdrops aren't fun and that is why egghelp exists.. haw
<sp33chy> Google says: (auto->de) Translation: English (automatically detected) » German >> manchmal sind nicht eggdrops Spaß und das ist der Grund, warum egghelp existiert .. Haw
<speechles> !tr auto@en manchmal sind nicht eggdrops Spaß und das ist der Grund, warum egghelp existiert .. Haw
<sp33chy> Google says: (auto->en) Translation: German (automatically detected) » English >> eggdrops sometimes are not fun and this is the reason why egghelp exists .. Haw
Now as google adds more languages, the script will natively support every single one of them as well as their potential error messages regarding their lack of support. This beats a static, 'sorry, this translation pair isn't supported' message any day me thinks. 8)

2nd NOTE: When having problems with output, sometimes using auto for source language can help. Conversely sometimes auto won't work correctly, and supplying the correct source language will. Allowing both helps a great deal. ;)
J
Jonathan1683
Voice
Posts: 10
Joined: Tue Jul 29, 2008 10:28 pm

Post by Jonathan1683 »

Everything else seems to work except !google and I dont see any errors in the party line. Is there a way to see the errors?
s
shadrach
Halfop
Posts: 74
Joined: Fri Dec 14, 2007 6:29 pm

Post by shadrach »

Youtube isn't working in my script. I don't think it's anything I changed - intentionally at least.

Code: Select all

[18:44] Tcl error [incith::google::public_message]: can't read "reply": no such variable
All the other aspects work fine.
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

shadrach wrote:Youtube isn't working in my script. I don't think it's anything I changed - intentionally at least.

Code: Select all

[18:44] Tcl error [incith::google::public_message]: can't read "reply": no such variable
All the other aspects work fine.
Wow, I just fixed that thing. Now it's giving a 303 error when attempting to contact "youtube.com", LMAO!! Only the "com" server was affected, any other server domain would've worked. But I've now fixed it as seen below.. so no worries.
<speechles> !y irc
<sp33chy> 7,020 video results | Connect to IRC Chat room on iPod Touch (08:30) @ http://youtube.com/watch?v=zP9rWHuOka8&fmt=18 | Live Chat and IRC on iPhone (06:35) @ http://youtube.com/watch?v=BhflSlTsbrk&fmt=18 | IRC afghan education (03:28) @ http://youtube.com/watch?v=l3jhcJfGs3k&fmt=18 | IRC Chat Safety and Security (07:50) @ http://youtube.com/watch?v=K5jFm3m2O38&fmt=18 | A video profile
<sp33chy> of the IRC, hosted by (06:49) @ http://youtube.com/watch?v=kfPNz6d1tfI&fmt=18
Get the newest version of the script Here (v1.9.8r) or the first post of this thread. As always, have a fun :D

@Jonathan1683, the script has a hidden debug feature. Right after you get that reply from google, immediately afterwards. Look in your eggdrop root for a text file named "ig-debug.txt". This file contains the html dump from the last command used. This is what I will need to see to customize the templates within the script to work with that google server (not all google servers are properly templated as I can only add servers I run across). So if you post that to some filesharing site and post a link here to it. I can do more than wonder what's wrong, I can actually fix it.
a
arbiter
Voice
Posts: 8
Joined: Mon Oct 24, 2005 8:21 pm

Post by arbiter »

Jonathan1683 wrote:still getting this error

Code: Select all

[22:23] Tcl error [incith::google::public_message]: Unknown option -urlencoding, must be: -accept, -proxyfilter, -proxyhost, -proxyport, -useragent
I have http2.5
i am gettin same error on 1.9.5r and also have http 2.5

Jonathan1683, use this http.tcl, it will fix it =)
s
superjet
Voice
Posts: 8
Joined: Sun Aug 03, 2008 1:09 pm

Post by superjet »

error character convert using !translate in zh_CN.UTF-8 + eggdrop-1.6.19 environment after patching eggdrop:

Getting eggdrop ready for UTF-8
http://forum.egghelp.org/viewtopic.php? ... light=utf8

I made one patch according to !translate function in incith-google-v1.98r.tcl, however, it just works to translate English into Chinese and failed to translate Chinese back into English.

Any suggestions will be appreciated!

Code: Select all

!translate en@zh-CN dictionary
Google says: (en->zh-CN) 字典

Code: Select all

!translate zh-CN@en 字典
Google says: (zh-CN->en) Ying Yumie

Code: Select all

--- incith-google-v1.98r.tcl-ori
+++ incith-google-v1.98r.tcl
@@ -2361,16 +2361,16 @@
       regexp -nocase -- {^(.+?)@(.+?)\s(.+?)$} $input - link desc titem

       # fetch the html

       set ua "Lynx/2.8.5rel.1 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/0.9.7e"

-      set http [::http::config -useragent $ua -urlencoding "iso8859-1"]

+      set http [::http::config -useragent $ua -urlencoding "utf-8"]

       set url "http://www.google.com/translate_t?"

       set query [::http::formatQuery text $titem sl "${link}" tl "${desc}" ]

 	catch {set http [::http::geturl "$url" -query $query -timeout [expr 1000 * 10]]} error

 

       # CHECK CHECK

       upvar #0 $http state

-      set incithcharset [string map -nocase {"UTF-" "utf-" "iso-" "iso" "windows-" "cp" "shift_jis" "shiftjis"} $state(charset)]

+      set incithcharset [string map -nocase {"UTF-" "utf-" "iso-" "iso" "windows-" "cp" "shift_jis" "shiftjis" "gb2312" "big5"} $state(charset)]

       if {$incith::google::debug > 0} {

-        putserv "privmsg $incith::google::debugnick :\002url:\002 $url$query \002\037charset:\002\037 [string map -nocase {"iso-" "iso" "windows-" "cp" "shift_jis" "shiftjis"} $incithcharset]"

+        putserv "privmsg $incith::google::debugnick :\002url:\002 $url$query \002\037charset:\002\037 [string map -nocase {"iso-" "iso" "windows-" "cp" "shift_jis" "shiftjis" "gb2312" "big5"} $incithcharset]"

       }

 	if {[string match -nocase "*couldn't open socket*" $error]} {

 		return "Socket Error accessing '${url}' .. Does it exist?"

@@ -2397,14 +2397,19 @@
       regsub -all ";;>" $html "" html

 

       # make sure everything is lowercase.

-      set desc [string tolower $desc]

-      set link [string tolower $link]

+#      set desc [string tolower $desc]

+#      set link [string tolower $link]

+      set desc $desc

+      set link $link

+

       if {![regexp -- {</td><td id=autotrans style="display: block">(.+?)</td></tr>} $html {} detect]} {set detect ""}

       regexp -- {<textarea name=utrans.+?id=suggestion>(.+?)</textarea>} $html - match

       if {$match != ""} {

-       return "Google says\: \(${link}\-\>${desc}\)\ [incithencode [descdecode "$detect >> ${match}"]]"

+       return "Google says\: \(${link}\-\>${desc}\)\ ${match}"

+#      return "Google says\: \(${link}\-\>${desc}\)\ [incithencode [descdecode "$detect >> ${match}"]]"

       } else {

-        return "Google error\: \(${link}\-\>${desc}\)\ [incithencode [descdecode "$detect."]]"

+#        return "Google error\: \(${link}\-\>${desc}\)\ [incithencode [descdecode "$detect."]]"

+        return "Google error\: \(${link}\-\>${desc}\)\ "$detect.""

       }

       return $output

     }

User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

Code: Select all

!translate zh-CN@en 字典 
Try using auto for source language, you may get better results.

Code: Select all

!translate auto@en <chinese language goes here>
setting the urlencoding to utf-8 or iso8859-1 makes little difference to google translations. They will serve you up a charset based encoding rather than utf-8 every time and is why the script follows the exact charset encoding google has told it to use when translating. But try using:

Code: Select all

!tr auto@<dest> <text to translate here>
Replacing dest of course with the language to translate to and text with what you wish to translate.

Also, appears by your quote below you aren't using the smarter version of the script.
!translate zh-CN@en 字典
Google says: (zh-CN->en) Ying Yumie
!tr auto@en manchmal sind nicht eggdrops Spaß und das ist der Grund, warum egghelp existiert .. Haw
Google says: (auto->en) Translation: German (automatically detected) » English >> eggdrops sometimes are not fun and this is the reason why egghelp exists .. Haw
The bottom is the newer look for the output display. It will give the shortcuts first, the ones you enter. Afterwards are the longname languages translated from and to, and whether it was an automatic guess or not. Followed by a pair of greater than signs >> which leads to the translated sentence. This is a much better way to do it, regetting the r version of the script gives this new ability to use auto.
s
superjet
Voice
Posts: 8
Joined: Sun Aug 03, 2008 1:09 pm

Post by superjet »

doesn't work with auto@en

Code: Select all

!tr auto@en 字典
Google says: (auto->en) å - å~E ¸

!tr zh-CN@en 字典
Google says: (zh-CN->en) Ying Yumie
however, it works with your example

Code: Select all

!tr auto@en manchmal sind nicht eggdrops Spaß und das ist der Grund, warum egghelp existiert .. Haw 
Google says: (auto->en) sometimes are not eggdrops SpaÃ~_ and this is the reason why egghelp exists .. Haw
It doesn't work also using the original eggdrop without utf-8 patch

Code: Select all

!tr auto@zh-CN dictionary
Google says: (auto->zh-cn) Translation: English (automatically detected) ? Chinese >> ?ֵ?

Code: Select all

!tr auto@en 字典
Google says: (auto->en) Translation: Polish (automatically detected) ? English >> Wx
so, it maybe duce to the fault of eggdrop not incith-google.[/code]
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

It might also be a flaw within http package itself it seems... it works around utf-8 somewhat as well
Post Reply