Code: Select all
<&maruda> !trans jp@en オタク
<~Lilith> Google says: (ja->en) Translation: Japanese » English >> ŞŻGerman German German circumstances
Code: Select all
<tomek> !g オタク
<~Lilith> 7,360,000 Results | ĄŞ? Ą?? §?????$ @ http://jahjahsphinx.blogspot.com/ | ĄŞ? Ą?? §?????$ @ http://jahjahsphinx.blogspot.com/2009/08/blog-post.html | Ordinal indicator - Wikipedia, the free @ http://en.wikipedia.org/wiki/Ordinal_indicator | [PDF] : Ş " " Ş ˙ . . : Ş : 1. . 2 @ http://www.bibalex.org/ARABIC/Egyptology/images/coptlanglect.pdf
Code: Select all
Tcl error [incith::google::public_message]: can't read "f2": no such variable
Trans has issues regarding eggdrop and how it improperly handles utf-8. Also, http-package has large flaws which this script presently only fixes slightly (See here for http-packages flaw).Anahel wrote:i've other problem with your google script (im using the newest "m" version)
when i use !trans with japanese characters bot send [censored] to channel:
Code: Select all
<&maruda> !trans jp@en オタク <~Lilith> Google says: (ja->en) Translation: Japanese » English >> ŞŻGerman German German circumstances
Anahel wrote:and heres google:
maybe i've something unset with charset (i havent changed anything about it - only changes i've made was set wiki to .pl language, even google is set to .com)Code: Select all
<tomek> !g オタク <~Lilith> 7,360,000 Results | ĄŞ? Ą?? §?????$ @ http://jahjahsphinx.blogspot.com/ | ĄŞ? Ą?? §?????$ @ http://jahjahsphinx.blogspot.com/2009/08/blog-post.html | Ordinal indicator - Wikipedia, the free @ http://en.wikipedia.org/wiki/Ordinal_indicator | [PDF] : Ş " " Ş ˙ . . : Ş : 1. . 2 @ http://www.bibalex.org/ARABIC/Egyptology/images/coptlanglect.pdf
could you help me?
Code: Select all
# encoding conversion lookups
# here is where you can correct language encoding problems by pointing their
# abbreviation towards an encoding. if you want more, feel free to add more.
# this is a somewhat poor example below, there are possibly hundreds of additions
# that need to be added to this section, this is just something to see if this
# indeed is a work around, enjoy and merry christmas ;P
# ------
variable encode_strings {
zh:gb2312
de:iso8859-1
es:iso8859-1
it:iso8859-1
nl:iso8859-1
com:iso8859-1
co.uk:iso8859-1
en:iso8859-1
fr:iso8859-1
ro:cp1251
bg:cp1251
rs:cp1251
sr:cp1251
sr-el:cp1252
ru:cp1251
ar:cp1256
jp:shiftjis
ja:shiftjis
co.jp:shiftjis
tr:cp857
kr:iso2022-kr
co.kr:iso2022-kr
co.il:iso8859-8
com.ua:koi8-u
uk:koi8-u
hu:cp1250
pl:iso8859-2
}
Doh! Why didn't you say something two days ago?! HAWgh0st wrote:i got this error since 2 days with the weather script. im using incith-google-v1.99m
Code: Select all
Tcl error [incith::google::public_message]: can't read "f2": no such variable
Code: Select all
# .9n: Corrected google weather and cruft html elements within#
# some google no-results-found messages. #
Incith:Google v1.9.9n. Enjoy and as always, have a fun ;P<speechles> !g .de wetter berlin
<sp33chy> Wetter für Berlin: 24 °C, Aktuell: Klar, Wind: SO mit 11 km/h, Feuchtigkeit: 44 %; Forecast: Do., Sunny (31°C|18°C); Fr., Chance of storm (29°C|14°C); Sa., Mostly sunny (23°C|10°C)
<speechles> !g .nl weer amsterdam
<sp33chy> Weer voor Amsterdam: 19 °C, Actueel: Plaatselijk bewolkt, Wind: W - 16 km/h, Luchtvochtigheid: 63%; Forecast: do, Chance of storm (29°C|15°C); vr, Chance of rain (21°C|13°C); za, Chance of rain (21°C|12°C)
<speechles> !g weather san francisco, california
<sp33chy> Weather for San Francisco, California: 67°F, Current: Partly Cloudy, Wind: NW at 6 mph, Humidity: 73%; Forecast: Thu, Mostly sunny (63°F|54°F); Fri, Mostly sunny (67°F|56°F); Sat, Mostly sunny (67°F|54°F)
Shipping and all parsing is now detected perfectly (an empty shipping field indicates just that this isn't a bug). This uses several different templates and schemes to extract information from almost every regional ebay server you feed it. The ones above are merely examples demonstrating this behavior. There are several more you can use as well somewhere around 20ish or so. This update has also corrected the bug within google video display causing things to run together.-- singapore
<speechles> !e .com.sg bubble gum
<sp33chy> 19 results | Vincci Bubblegum Pop Colorful Opentoe He, S$ 9.90(+S$ 2.50), 0 Bids, 8h 25m @ http://cgi.ebay.com.sg/_W0QQItemZ250483340761 | BN Bonne Bell Bubble Gum Lip Smacker Glo, S$ 4.50(Free), Buy It Now, 2h 45m @ http://cgi.ebay.com.sg/_W0QQItemZ250483289799 | Japanese Animation - Bubblegum Crisis To, S$ 3.00(+S$ 2.00), 0 Bids, 1d 3h 27m @ http://cgi.ebay.com.sg/_W0QQItemZ270444229706
-- malaysia
<speechles> !e .com.my bride
<sp33chy> 148 results | BRAND NEW The Petrakos Bride by Lynne Gr, RM 18.00(+RM 4.00), 0 Bids, 3h 9m @ http://cgi.ebay.com.my/_W0QQItemZ380149390697 | NEW The Italian's Future Bride by Michel, RM 18.00(+RM 4.00), 0 Bids, 3h 17m @ http://cgi.ebay.com.my/_W0QQItemZ380149391616 | NEW The Ranieri Bride by Michelle Reid, RM 18.00(+RM 4.00), 0 Bids, 3h 18m @ http://cgi.ebay.com.my/_W0QQItemZ380149391840
-- germany
<speechles> !e .de eier
<sp33chy> 45.236 Ergebnisse | WAHNSINNNNNN zwischen 2500 und 2700 Hpf, EUR 20,50(+EUR 15,00), 11 Gebote, 6T 16Std 38Min @ http://cgi.ebay.de/_W0QQItemZ230368738997 | O EI A Jubelausgabe 2003-04, EUR 1,00(+EUR 4,90), 0 Gebote, 25Min @ http://cgi.ebay.de/_W0QQItemZ350241866986 | Ü-Ei Figur Sonne, Mond und Sterne Stern, EUR 1,00(+EUR 2,00), 0 Gebote, 41Min @ http://cgi.ebay.de/_W0QQItemZ130324363220
-- united states
<speechles> !e .com eggs
<sp33chy> 18,628 results | 155.0ct RUBY AMETHYST GARNET BT STERLING, $202.50(), 10 Bids, 6d 17h 26m @ http://cgi.ebay.com/_W0QQItemZ310162811776 | Little Giant Egg Incubator w/ Forced Air, $142.95(Free shipping), Buy It Now, 26d 11h 41m @ http://cgi.ebay.com/_W0QQItemZ330353195089 | Ped Egg Professional Pedicure & 3 File B, $7.49(Free shipping), Buy It Now, 8d 17h 23m @ http://cgi.ebay.com/_W0QQItemZ260465595310
-- france
<speechles> !e .fr pink
<sp33chy> 24 022 résultats | 6 ÉPINGLES À CHEVEUX MARIÉE MARIAGE PART, 4,99 EUR(+3,99 EUR), 0 Enchère, 6m @ http://cgi.ebay.fr/_W0QQItemZ140339874791 | BONNET DE NAISSANCE "J'AIME PAPA" - ROSE, 3,50 EUR(+1,88 EUR), Achat immédiat, 8j 7h 17m @ http://cgi.ebay.fr/_W0QQItemZ200375358198 | GANTS SANS DOIGT MARIÉE MARIAGE PARTIE ~, 4,99 EUR(+3,99 EUR), 0 Enchère, 7m @ http://cgi.ebay.fr/_W0QQItemZ140339874835
Code: Select all
# Google translation input/output encodings
# set these below to either:
# 0 for automatic encoding
# 1 for utf-8
# You may use switches to inverse this behavior on-the-fly. Set them
# below as well.
# ------
variable trans_input 1
variable trans_output 0
variable trans_input_t "--swapi"
variable trans_output_t "--swapo"
The problem here is that choosing utf-8, which --swapo does in this case (using default options shown above), there is no notable difference between the automatic (iso8859-1, in this case) representation and the utf-8 one. Not until you start to deal with accented characters and eggdrop mishandles things. If your bot is patched with either the suzi or utf-8 patch this may work wonders now for you, as every query within google now embeds the encoding within the query line. This wasn't happening before and was the reason for alot of the problems. Utf-8 folks should now be alot happier. Even if you aren't using utf-8, this works much better than any previous version...Using 1 for input encoding seems to solves the accented character problem as shown below:
<speechles> !tr Google Traducciones parece odiar eggdrops por alguna razón
<sp33chy> Google says: (auto->en) Translation: Galician (automatically detected) » English >> Google seems to hate eggdrops translations for some reason
<speechles> !tr Google Traducciones parece odiar eggdrops por alguna razón --swapi
<sp33chy> Google says: (auto->en) Translation: Galician (automatically detected) » English >> Google translations seem to hate any race for eggdrops § Ã £ o
Now the problem with using 1 for output encoding is that it doesn't seem to work for all languages. This is probably a direct result of eggdrop not being able to handle utf-8 correctly which 1 means.. But, you do have the ability to inversely affect the output encodings as shown below:
<speechles> !tr Google Traducciones parece odiar eggdrops por alguna razón --swapo
<sp33chy> Google says: (auto->en) Translation: Galician (automatically detected) » English >> Google seems to hate eggdrops translations for some reason
Keep in mind you can place these "switches" anywhere in the string and they will be properly detected and removed. So you must be careful what you name them to keep them from being seen as of any text you may wish to translate. The debug output during these queries (if enabled and debugnick is set correctly) will clearly indicate which encodings are being used each time.
Code: Select all
<tomek> !tr pl@en liść
<~Lilith> Google says: (pl->en) Translation: Polish » English >> If [?
<tomek> !tr ja@en 私
<~Lilith> Google says: (ja->en) Translation: Japanese » English >> Á
Code: Select all
<&anahel> !tr pl@en gość
<~Lilith> Google says: (pl->en) Translation: Polish » English >> it [?
<&anahel> !tr jp@en ポオランド
<~Lilith> Google says: (ja->en) Translation: Japanese » English >> ÝŞ éóÉ
Code: Select all
<tomek> !tr Google Traducciones parece odiar eggdrops por alguna razón
<~Lilith> Google says: (auto->en) Translation: Galician (automatically detected) » English >> Google seems to hate eggdrops translations for some reason
the output:[21:36:14] ( transacid) !g hl:de define:potz
Code: Select all
[22:27:15] ( transacid) !w plenk
[22:27:16] ( NeXuS) Wikimedia Error: Unable to parse for: plenk @
http://en.wikipedia.org/wiki/index.php?title=Special%3ASearch&search=plenk&fulltext=Search
It's bound to happen eventually. It's simply the nature of web scraping. Html changes with the wind. In a perfect (read this as free API) world we wouldn't need to screen/web scrape a thing. But this world we live in is far from that...transacid wrote:apparently there is something wrong with the parser. (besides the wrong usage but this shouldn't happen at all IMHO)
Note: This is actually a bug within wikipedia/wikimedia sites themselves, not anything lacking in the script. The problem has to do with problematic squid caches returning outdated incorrect replies. See here for more info.transacid wrote:Code: Select all
[22:27:15] ( transacid) !w plenk [22:27:16] ( NeXuS) Wikimedia Error: Unable to parse for: plenk @ http://en.wikipedia.org/wiki/index.php?title=Special%3ASearch&search=plenk&fulltext=Search
Code: Select all
# set this to the proxy you wish the main html fetching procedure to
# use. set both proxy_host and proxy_port. if you don't wish to use
# a proxy. set proxy_host ""
# --
variable proxy_host ""
variable proxy_port ""
# set this to the switch you want to use for youtube to filter content
# and display only high-definition videos.
# ------
variable youtube_highdef "@hd"
Edit: While on the subject of gzipped webpages. Why not incorporate this bandwidth saving feature into the script. This has now been done. If you have zlib or trf packages handy on your bot this script will now use them and save bandwidth using it for every query it makes. In my tests this seems to speed up page loading considerably. It is not a requirement to use zlib or trf packages, the script will still function without them. But for those with it, you will notice better response times.<speechles> !wm .en.wikipedia.org/wiki Plenk
<sp33chy> Plenken | Plenken is a German typographical term for the insertion of inappropriate spaces before a punctuation mark. Its counterpart is Klempen, the incorrect omission of a space after punctuation marks. @ http://en.wikipedia.org/wiki/Plenken
<speechles> !w Plenk
<sp33chy> Plenken | Plenken is a German typographical term for the insertion of inappropriate spaces before a punctuation mark. Its counterpart is Klempen, the incorrect omission of a space after punctuation marks. @ http://en.wikipedia.org/wiki/Plenken
<speechles> !g hl:de define:potz
<sp33chy> 549 Results | Did you mean: hl:dt define:putz | Urban Dictionary: potz @ http://www.urbandictionary.com/define.php?term=potz | Specificity of antibodies produced again @ http://www.pubmedcentral.nih.gov/articl ... tid=237545 | Mutations within the proteolytic cleavag @ http://www.pubmedcentral.nih.gov/articl ... tid=240787
As you can see above using webby to illustrate. Simply gzipping the query arrives at 9576 bytes. While the entire html would've been 23390 bytes. This equates to quite a savings over time. Enjoy, and most important. Have a fun ;P<speechles> !webby http://en.wikipedia.org/wiki/index.php? ... ext=Search --gz
<sp33chy> plenk - Search results - Wikipedia, the free encyclopedia ( http://u.nu/67t73 )( 200; text/html; utf-8; 9576 bytes (gzip); 23390 bytes )
The shell provider and I worked on the issue and came up with this solution. Alter the code as needed.Incith:Google : Unable to find zlib package. Wikipedia and Wikimedia require gzip decompression. As a result, every article will not work for you.
For tcl 8.6b1.1 users and below. "DO NOT ALTER THIS CODE":pkg_info | grep tcl
Anyone who is using tcl 8.6b1.1 and above, go ahead and modify the previous line to suit the following:if {[catch {package require zlib} error] !=0} {
Shell provider: "Just tell him that the zlib package is now a part of tcl and does not need to be loaded".if {[lsearch [info commands] zlib] == -1 && [catch {package require zlib} error] !=0} {
Another side note. If you are compiling eggdrop-1.6.19 on tcl 8.6* you may have some difficulty unless you hack into the compilation process first. Add the following code to config.h in between ./configure and make config.#if {[catch {package require zlib} error] !=0} {
#putlog "Incith:Google : Unable to find zlib package. Wikipedia and Wikimedia require gzip decompression. As a result, every article will not work for you."
#set incith_nozlib 1
#set incith_hdr ""
#} else {
set incith_hdr "Accept-Encoding gzip,deflate"
#}
Enjoy,#define USE_INTERP_RESULT 1