| View previous topic :: View next topic |
| Author |
Message |
MellowB Voice
Joined: 23 Jan 2008 Posts: 24 Location: Germany
|
Posted: Sat Jul 26, 2008 11:01 am Post subject: |
|
|
Did !yt stop working or is my host now blocked or something like that? :>
Getting this on a YouTube request:
| Code: | | <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. |
|
| Back to top |
|
 |
speechles Revered One

Joined: 26 Aug 2006 Posts: 1398 Location: emerald triangle, california (coastal redwoods)
|
Posted: Sat Jul 26, 2008 3:05 pm Post subject: |
|
|
| MellowB wrote: | Did !yt stop working or is my host now blocked or something like that? :>
Getting this on a YouTube request:
| Code: | | <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: | 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? _________________ speechles' eggdrop tcl archive |
|
| Back to top |
|
 |
MellowB Voice
Joined: 23 Jan 2008 Posts: 24 Location: Germany
|
Posted: Sat Jul 26, 2008 4:00 pm Post subject: |
|
|
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: | 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. |
|
| Back to top |
|
 |
testebr Halfop
Joined: 01 Dec 2005 Posts: 86
|
Posted: Sat Jul 26, 2008 8:41 pm Post subject: |
|
|
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. |
|
| Back to top |
|
 |
Jonathan1683 Voice
Joined: 29 Jul 2008 Posts: 10
|
Posted: Tue Jul 29, 2008 10:34 pm Post subject: |
|
|
still getting this error
| Code: |
[22:23] Tcl error [incith::google::public_message]: Unknown option -urlencoding, must be: -accept, -proxyfilter, -proxyhost, -proxyport, -useragent |
I have http2.5 |
|
| Back to top |
|
 |
Phyxion Voice
Joined: 30 Jul 2008 Posts: 7
|
Posted: Wed Jul 30, 2008 7:26 am Post subject: |
|
|
Thanks for this great script!
DailyMotion is broken in all builds you posted. Seems they updated their code.
Greetings. |
|
| Back to top |
|
 |
speechles Revered One

Joined: 26 Aug 2006 Posts: 1398 Location: emerald triangle, california (coastal redwoods)
|
Posted: Wed Jul 30, 2008 4:35 pm Post subject: |
|
|
| Phyxion wrote: | Thanks for this great script!
DailyMotion is broken in all builds you posted. Seems they updated their code.
Greetings. |
DOH!
| Code: | # 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.
Now it looks elegant again.. yay!! Get the new script here or this first post of this thread. As always, have a fun
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. | Quote: | <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.
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.  _________________ speechles' eggdrop tcl archive |
|
| Back to top |
|
 |
Jonathan1683 Voice
Joined: 29 Jul 2008 Posts: 10
|
Posted: Thu Jul 31, 2008 12:25 am Post subject: |
|
|
| 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? |
|
| Back to top |
|
 |
shadrach Halfop
Joined: 14 Dec 2007 Posts: 74
|
Posted: Thu Jul 31, 2008 1:50 pm Post subject: |
|
|
Youtube isn't working in my script. I don't think it's anything I changed - intentionally at least.
| Code: | | [18:44] Tcl error [incith::google::public_message]: can't read "reply": no such variable |
All the other aspects work fine. |
|
| Back to top |
|
 |
speechles Revered One

Joined: 26 Aug 2006 Posts: 1398 Location: emerald triangle, california (coastal redwoods)
|
Posted: Thu Jul 31, 2008 2:14 pm Post subject: |
|
|
| shadrach wrote: | Youtube isn't working in my script. I don't think it's anything I changed - intentionally at least.
| Code: | | [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.
Get the newest version of the script Here (v1.9.8r) or the first post of this thread. As always, have a fun
@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. _________________ speechles' eggdrop tcl archive |
|
| Back to top |
|
 |
arbiter Voice
Joined: 24 Oct 2005 Posts: 8
|
Posted: Fri Aug 01, 2008 4:49 am Post subject: |
|
|
| Jonathan1683 wrote: | still getting this error
| Code: |
[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 =) |
|
| Back to top |
|
 |
superjet Voice
Joined: 03 Aug 2008 Posts: 8
|
Posted: Sun Aug 03, 2008 1:42 pm Post subject: |
|
|
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?t=13932&highlight=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: |
!translate en@zh-CN dictionary
Google says: (en->zh-CN) 字典
|
| Code: |
!translate zh-CN@en 字典
Google says: (zh-CN->en) Ying Yumie
|
| Code: |
--- 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
}
|
|
|
| Back to top |
|
 |
speechles Revered One

Joined: 26 Aug 2006 Posts: 1398 Location: emerald triangle, california (coastal redwoods)
|
Posted: Sun Aug 03, 2008 2:29 pm Post subject: |
|
|
| Code: | | !translate zh-CN@en 字典 |
Try using auto for source language, you may get better results.
| Code: | | !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: | | !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. | Quote: | !translate zh-CN@en 字典
Google says: (zh-CN->en) Ying Yumie |
| Quote: | !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. _________________ speechles' eggdrop tcl archive |
|
| Back to top |
|
 |
superjet Voice
Joined: 03 Aug 2008 Posts: 8
|
Posted: Sun Aug 03, 2008 9:25 pm Post subject: |
|
|
doesn't work with auto@en
| Code: |
!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: |
!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: |
!tr auto@zh-CN dictionary
Google says: (auto->zh-cn) Translation: English (automatically detected) ? Chinese >> ?ֵ?
|
| Code: |
!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] |
|
| Back to top |
|
 |
speechles Revered One

Joined: 26 Aug 2006 Posts: 1398 Location: emerald triangle, california (coastal redwoods)
|
Posted: Sun Aug 03, 2008 10:17 pm Post subject: |
|
|
It might also be a flaw within http package itself it seems... it works around utf-8 somewhat as well _________________ speechles' eggdrop tcl archive |
|
| Back to top |
|
 |
|
|
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
|
|