egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

UNOFFICIAL incith-google 2.1x (Nov30,2o12)
Goto page Previous  1, 2, 3 ... 18, 19, 20 ... 56, 57, 58  Next
 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases
View previous topic :: View next topic  
Author Message
MellowB
Voice


Joined: 23 Jan 2008
Posts: 24
Location: Germany

PostPosted: Sat Jul 26, 2008 11:01 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
speechles
Revered One


Joined: 26 Aug 2006
Posts: 1398
Location: emerald triangle, california (coastal redwoods)

PostPosted: Sat Jul 26, 2008 3:05 pm    Post subject: Reply with quote

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. Wink

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
View user's profile Send private message
MellowB
Voice


Joined: 23 Jan 2008
Posts: 24
Location: Germany

PostPosted: Sat Jul 26, 2008 4:00 pm    Post subject: Reply with quote

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! Smile
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
View user's profile Send private message Visit poster's website
testebr
Halfop


Joined: 01 Dec 2005
Posts: 86

PostPosted: Sat Jul 26, 2008 8:41 pm    Post subject: Reply with quote

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
View user's profile Send private message
Jonathan1683
Voice


Joined: 29 Jul 2008
Posts: 10

PostPosted: Tue Jul 29, 2008 10:34 pm    Post subject: Reply with quote

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
View user's profile Send private message
Phyxion
Voice


Joined: 30 Jul 2008
Posts: 7

PostPosted: Wed Jul 30, 2008 7:26 am    Post subject: Reply with quote

Thanks for this great script!

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

Greetings.
Back to top
View user's profile Send private message
speechles
Revered One


Joined: 26 Aug 2006
Posts: 1398
Location: emerald triangle, california (coastal redwoods)

PostPosted: Wed Jul 30, 2008 4:35 pm    Post subject: Reply with quote

Phyxion wrote:
Thanks for this great script!

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

Greetings.

DOH! Crying or Very sad
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 Wink. Below is a sample of how this appears internationally and refined.
Quote:
<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 Razz

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. Cool

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. Wink
_________________
speechles' eggdrop tcl archive
Back to top
View user's profile Send private message
Jonathan1683
Voice


Joined: 29 Jul 2008
Posts: 10

PostPosted: Thu Jul 31, 2008 12:25 am    Post subject: Reply with quote

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
View user's profile Send private message
shadrach
Halfop


Joined: 14 Dec 2007
Posts: 74

PostPosted: Thu Jul 31, 2008 1:50 pm    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
speechles
Revered One


Joined: 26 Aug 2006
Posts: 1398
Location: emerald triangle, california (coastal redwoods)

PostPosted: Thu Jul 31, 2008 2:14 pm    Post subject: Reply with quote

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.
Quote:
<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 Very Happy

@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
View user's profile Send private message
arbiter
Voice


Joined: 24 Oct 2005
Posts: 8

PostPosted: Fri Aug 01, 2008 4:49 am    Post subject: Reply with quote

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
View user's profile Send private message AIM Address MSN Messenger
superjet
Voice


Joined: 03 Aug 2008
Posts: 8

PostPosted: Sun Aug 03, 2008 1:42 pm    Post subject: Reply with quote

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
View user's profile Send private message
speechles
Revered One


Joined: 26 Aug 2006
Posts: 1398
Location: emerald triangle, california (coastal redwoods)

PostPosted: Sun Aug 03, 2008 2:29 pm    Post subject: Reply with quote

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
View user's profile Send private message
superjet
Voice


Joined: 03 Aug 2008
Posts: 8

PostPosted: Sun Aug 03, 2008 9:25 pm    Post subject: Reply with quote

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
View user's profile Send private message
speechles
Revered One


Joined: 26 Aug 2006
Posts: 1398
Location: emerald triangle, california (coastal redwoods)

PostPosted: Sun Aug 03, 2008 10:17 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases All times are GMT - 4 Hours
Goto page Previous  1, 2, 3 ... 18, 19, 20 ... 56, 57, 58  Next
Page 19 of 58

 
Jump to:  
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


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber