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
B
Behemoth
Voice
Posts: 20
Joined: Mon May 19, 2008 7:23 am
Location: Mauritius
Contact:

Post by Behemoth »

hello speechless

Happy New Year 2010 !!!

am having this in the PL :

Code: Select all

 
[22:05:00] <(Kestrel> [22:04] Incith:Google unable to find zlib or trf package! Gzip disabled.
[22:05:00] <(Kestrel> [22:04] Incith:Google requires gzip decompression with wikipedia and Wikimedia. As a result, every article will not work for you.
Help me out plz...

PS: I have changed the language into 'fr'

regards

Atem
Http://optix-pro.labrute.fr/
Http://ircaz.fr/

Losers Always Whine About Their Best, But Winners Go Home And F*** The Prom Queen!
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

Behemoth wrote:hello speechless

Happy New Year 2010 !!!

am having this in the PL :

Code: Select all

 
[22:05:00] <(Kestrel> [22:04] Incith:Google unable to find zlib or trf package! Gzip disabled.
[22:05:00] <(Kestrel> [22:04] Incith:Google requires gzip decompression with wikipedia and Wikimedia. As a result, every article will not work for you.
This isn't actually an error as much as a warning that sometimes wikipedia/mediawiki sites using squid caches may return a gzipped reply when gzip has not been requested. This occurs quite rarely so shouldn't be that much of a concern. To support gzip you must either have zlib or Trf packages installed -OR- The commands for zlib or Trf which do the decompressing must be found. If neither of these holds true, the script turns off gzip itself. You can also, force the script to keep gzip disabled all the time and stop self-checking by changing the config option "use_gzip" to 0. This will skip the normal routines which check for zlib/Trf and afterwards will never use gzip.
Behemoth wrote:Help me out plz...

PS: I have changed the language into 'fr'

regards

Atem
For all the country switches? ebay, google, wikipedia, dailymotion and youtube all have "fr" as an option.. ;) You can also set a default french site for wikimedia if you haven't already.
B
Behemoth
Voice
Posts: 20
Joined: Mon May 19, 2008 7:23 am
Location: Mauritius
Contact:

Post by Behemoth »

thnkx a lot speechless...

catch u later man..
xxx
Http://optix-pro.labrute.fr/
Http://ircaz.fr/

Losers Always Whine About Their Best, But Winners Go Home And F*** The Prom Queen!
c
cg
Voice
Posts: 8
Joined: Tue Jun 30, 2009 7:54 pm

Post by cg »

cg wrote:Hi there,

I've noticed a new error today;

11:01 <@ cg> !g barney the dinosaur
[11:01] Tcl error [incith::google::public_message]: can't read "state(body)": no such variable

Has anyone else experienced this? I am using the 'w' version.

Thanks!

I apologise in advance if this has been mentioned previously.
Hi Speechless,

Do you have an idea as to why this may be happening?

Thanks again for your time and this great script.

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

Post by speechles »

cg wrote:
cg wrote:Hi there,

I've noticed a new error today;

11:01 <@ cg> !g barney the dinosaur
[11:01] Tcl error [incith::google::public_message]: can't read "state(body)": no such variable

Has anyone else experienced this? I am using the 'w' version.

Thanks!

I apologise in advance if this has been mentioned previously.
Hi Speechless,

Do you have an idea as to why this may be happening?

Thanks again for your time and this great script.

Cheers,
cg
This occurs when a certain http::code is returned that the script isn't aware of, and attempts to get a page body when the http::code given clearly would tell why there would be no page body. This could be a forbidden error (usually a 501,502,503 etc). Might be a Google sorry, but these have page bodies. The script can parse the usual 503 google sorry if it has a page body..... Maybe this time yours doesn't? The easiest way to solve this is to find in your copy of the script where it says 'variable debugnick speechles'. Change the "speechles" to your nickname your using on irc. Make sure debug variable is set to 1 allowing messages to be sent to the debugnick too. After all this .rehash your bot. Then issue a "!g barney the dinosaur" in your channel and watch for the message your bot sends you in private message. What does that message say? Try it a couple times with different queries too. Paste a series of these which work and do not, and comparing the results should indicate where the problem is.

note to all: on efnet I see tons of bots message me daily. Seeing their messages helps me debug issues within this script, so if you use efnet change it back to "speechles" (this isn't so I can find you google loli porn, animal scat fetish or anything like that, all i really care about is return code and such) and you can help me debug strange things in the future as well. ;) join the channel mentioned next to the @efnet in the script and I can fix the issue 0sec most times.. :P
c
cg
Voice
Posts: 8
Joined: Tue Jun 30, 2009 7:54 pm

Post by cg »

Thanks for your reply :)

Its doing it with any !g $search that we input, all coming back with;

[14:11] Tcl error [incith::google::public_message]: can't read "state(body)": no such variable

I also did the debug change you suggested;
variable debug 1
variable debugnick cg

.. and rehash'd the bot, but it doesn't send me a private message.

I do wonder if its getting confused up with the iGoogle section of the page, as my workstation defaults to that and I don't recall ever asking it to :\
i'm in NZ, which google.com redirects to google.co.nz.

Cheers,
cg.
t
transacid
Voice
Posts: 12
Joined: Wed Aug 08, 2007 2:15 pm
Location: Hamburg / Germany
Contact:

Post by transacid »

speechles wrote:
cg wrote:
cg wrote:...
...
This occurs when a certain http::code is returned that the script isn't aware of, and attempts to get a page body when the http::code given clearly would tell why there would be no page body. This could be a forbidden error (usually a 501,502,503 etc). Might be a Google sorry, but these have page bodies. The script can parse the usual 503 google sorry if it has a page body..... Maybe this time yours doesn't? The easiest way to solve this is to find in your copy of the script where it says 'variable debugnick speechles'. Change the "speechles" to your nickname your using on irc. Make sure debug variable is set to 1 allowing messages to be sent to the debugnick too. After all this .rehash your bot. Then issue a "!g barney the dinosaur" in your channel and watch for the message your bot sends you in private message. What does that message say? Try it a couple times with different queries too. Paste a series of these which work and do not, and comparing the results should indicate where the problem is.

note to all: on efnet I see tons of bots message me daily. Seeing their messages helps me debug issues within this script, so if you use efnet change it back to "speechles" (this isn't so I can find you google loli porn, animal scat fetish or anything like that, all i really care about is return code and such) and you can help me debug strange things in the future as well. ;) join the channel mentioned next to the @efnet in the script and I can fix the issue 0sec most times.. :P
I have the exact same problem. same error message and debug is not sent to me.
User avatar
pogue
Voice
Posts: 28
Joined: Sun May 17, 2009 3:56 am
Contact:

Post by pogue »

Hi speechless & all,

I found a couple bugs in the script (and I'm using the latest one this time!)

First, the spelling query isn't returning the expected result.

Here is an example on the word "hallucinate" which only tells me the number of search results, but nothing about the word itself. The debug info is the third message.

Code: Select all

[11:20pm] <~pogue> !g spell:hallucinate
[11:20pm] <+BodyBuildingBot> 89,400 Results
[11:20pm] <BodyBuildingBot> url (200): http://www.google.com/search?q=spell%3Ahallucinate&safe=on&lr=lang_all&num=3&ie=utf-8 charset: utf-8 encode_string: iso8859-1 :: Cookie: SS=Q0=c3BlbGw6aGFsbHVjaW5hdGU; Cookie: PREF=ID=3f3266b67dd1f4c5:TM=1263446402:LM=1263446402:S=KgUBQzysBpczbETv; Cookie: NID=30=J8UU1i28c7fhi-qTQq-BMgR1h2qPrfnC0gJUuA7WlQ7YAsdRuVxOUFUvlKqMF-fQqWnG_iEiMR95J4T1k8mGCeO0o2dE7jMVqGm9km2WpT2Ce3-4TxgMZ0u-ZrZcQ0Id;
When I intentionally misspelled chocolate, it didn't say Did you mean: chocolate but told me that there are search results for it. I'm guessing there is a break too soon either being returned from Google or in the code.

Code: Select all

[11:22pm] <~pogue> !g spell:chocolete
[11:22pm] <+BodyBuildingBot> Showing results for spell:chocolate
[11:22pm] <BodyBuildingBot> url (200): http://www.google.com/search?q=spell%3Achocolete&safe=on&lr=lang_all&num=3&ie=utf-8 charset: utf-8 encode_string: iso8859-1 :: Cookie: SS=Q0=c3BlbGw6Y2hvY29sZXRl; Cookie: PREF=ID=8c8cee489601e77a:TM=1263446541:LM=1263446541:S=UB3D9kuNZjOqBe_R; Cookie: NID=30=vcHoGKRVmjfiSQjdXUWPfR3SMHnEXSaRfhpz1QhEV8hucps6Ei5tDJoIzEl7Yzj6PsAyw0kgAQME92cUjnHcUm2seuFbrxK0l1leyn6wrutGLpWyh47c3dchh1xBYMLr;
Finally, there is a minor error when doing a currency conversion and no debug result was returned.

Code: Select all

[11:15pm] <~pogue> !g .093985 USD to CAD
[11:15pm] <+BodyBuildingBot> Socket Error accessing 'http://www.google.093985/search?q=USD%20to%20CAD&safe=on&lr=lang_all&num=3&ie=utf-8' .. Does it exist?
As you can see, it appends the query with a period in it into the google URL and attempts to use that as the domain to search from. If someone does a search with 0.XYZ instead of .XYZ it works fine though.

Just wanted to make you aware of those. Thanks as usual!
pogue

Instead of telling me
Helpful Tools:
  • Notepad++: Windows Text Editor with TCL Syntax Highlighting
  • Pastebin TCL: For easy script collaboration
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

pogue wrote:Hi speechless & all,

I found a couple bugs in the script (and I'm using the latest one this time!)

First, the spelling query isn't returning the expected result.
Are you absolutely positive they aren't the expected results?
pogue wrote:Here is an example on the word "hallucinate" which only tells me the number of search results, but nothing about the word itself. The debug info is the third message.

Code: Select all

[11:20pm] <~pogue> !g spell:hallucinate
[11:20pm] <+BodyBuildingBot> 89,400 Results
[11:20pm] <BodyBuildingBot> url (200): http://www.google.com/search?q=spell%3Ahallucinate&safe=on&lr=lang_all&num=3&ie=utf-8 charset: utf-8 encode_string: iso8859-1 :: Cookie: SS=Q0=c3BlbGw6aGFsbHVjaW5hdGU; Cookie: PREF=ID=3f3266b67dd1f4c5:TM=1263446402:LM=1263446402:S=KgUBQzysBpczbETv; Cookie: NID=30=J8UU1i28c7fhi-qTQq-BMgR1h2qPrfnC0gJUuA7WlQ7YAsdRuVxOUFUvlKqMF-fQqWnG_iEiMR95J4T1k8mGCeO0o2dE7jMVqGm9km2WpT2Ce3-4TxgMZ0u-ZrZcQ0Id;
There is a reason your only getting the total number of results. Let me explain why I asked above if your sure that wasn't the right result. In all fairness, it is "correct". To understand the explanation though you must first take into account this is all in an effort to be fully multi-language. Therefore... any "script-generated" messages can never occur (or as infrequently as possible). This means everything must be parsed verbatim from the page to keep in line with this multi-language ability. This becomes a problem, because for web-searching a "correct spelling" would simply be missing the normal "did you mean" field. Now we can't just output "Spelling appears correct." because we want a multi-language feel to it. The only way to really do this, is to simply give the total number of results as our ouput if the spelling is correct and if it isn't to display whatever the "did you mean" message was. This is done entirely from parsing of the webpage. None of those messages are "script generated" in any way, nor could they be, nor should they be. I do have a new version where I've corrected this behavior so the message will always be either results or "did you mean". There won't be those weird times it says "showing results for..." messages any longer.
pogue wrote:When I intentionally misspelled chocolate, it didn't say Did you mean: chocolate but told me that there are search results for it. I'm guessing there is a break too soon either being returned from Google or in the code.

Code: Select all

[11:22pm] <~pogue> !g spell:chocolete
[11:22pm] <+BodyBuildingBot> Showing results for spell:chocolate
[11:22pm] <BodyBuildingBot> url (200): http://www.google.com/search?q=spell%3Achocolete&safe=on&lr=lang_all&num=3&ie=utf-8 charset: utf-8 encode_string: iso8859-1 :: Cookie: SS=Q0=c3BlbGw6Y2hvY29sZXRl; Cookie: PREF=ID=8c8cee489601e77a:TM=1263446541:LM=1263446541:S=UB3D9kuNZjOqBe_R; Cookie: NID=30=vcHoGKRVmjfiSQjdXUWPfR3SMHnEXSaRfhpz1QhEV8hucps6Ei5tDJoIzEl7Yzj6PsAyw0kgAQME92cUjnHcUm2seuFbrxK0l1leyn6wrutGLpWyh47c3dchh1xBYMLr;
This was actually because the "spell:" feature originally coded by incith didn't make full use of google's spelling function. Incith didn't let google know by appending the query with "&spell=1" that the "did you mean" was to be left intact. Without specifying this additional "&spell=1" during the query google may or may not give you a "did you mean". The _next_ version of this script will correctly make full use of google's spell function, supplying "&spell=1" and always returning either results/did-you-mean.

But...Yeah...There is one small problem, which is why I haven't released the new script yet. The "spell" feature presently uses the English phrase "spell:" as the start of your input as the mechanism to detect when to or when not to use the spell function. This makes it hard for users of other languages because it's going against the intentions of this script, and isn't multi-language. So presently I'm figuring a clever way to make this easy for everyone any language they may be using. But for proof here are some quote's from irc.
<speechles> !g .de spell:egg drip
<sp33chy> Meinten Sie: egg drop
<speechles> !g .nl spell:egg drip
<sp33chy> Bedoelde u: egg drop
<speechles> !g .com.au spell:egg drip
<sp33chy> Did you mean: egg drop
<speechles> !g spell:chocolete
<sp33chy> Did you mean: chocolate
<speechles> !g spell:chocolate
<sp33chy> 137,000,000 Results
pogue wrote:Finally, there is a minor error when doing a currency conversion and no debug result was returned.

Code: Select all

[11:15pm] <~pogue> !g .093985 USD to CAD
[11:15pm] <+BodyBuildingBot> Socket Error accessing 'http://www.google.093985/search?q=USD%20to%20CAD&safe=on&lr=lang_all&num=3&ie=utf-8' .. Does it exist?
As you can see, it appends the query with a period in it into the google URL and attempts to use that as the domain to search from. If someone does a search with 0.XYZ instead of .XYZ it works fine though.
This is actually a feature of the script. As google adds new regional servers, the script automatically supports them. The _next_ version will also support google's special searches found here. A small example quoted below.
<speechles> !g .com/linux eggdrop
<sp33chy>Google | eggdrop | freshmeat.net @ http://freshmeat.net/projects/eggdrop/ | mIRCStats Eggdrop Logger @ http://mel.sourceforge.net/ | Eggdrop | Get Eggdrop at SourceForge @ http://sourceforge.net/projects/eggdrop/
<speechles> !g .com/microsoft windows
<sp33chy>Google | Microsoft Windows: Windows 7, Windo @ http://www.microsoft.com/WINDOWS/ | Microsoft Windows - Wikipedia, the fre @ http://en.wikipedia.org/wiki/Microsoft_Windows | Windows home - Microsoft Windows @ http://windows.microsoft.com/
<speechles> !g .nl/microsoft windows
<sp33chy> Google | Microsoft Nederland @ http://www.microsoft.com/netherlands/ | Microsoft Windows - Wikipedia @ http://nl.wikipedia.org/wiki/Microsoft_Windows | Startpagina Windows 7 - Microsoft Windows @ http://windows.microsoft.com/nl-nl/wind ... me?os=win7
<speechles> !g .com/univ/mit rainbows
<sp33chy>Google | Polarization: Light Waves, Rainbows, a @ http://mitworld.mit.edu/video/74 | Scratch | Project | Rainbows!!! @ http://scratch.mit.edu/projects/hippiegirl/834715 | CD REVIEW 'In Rainbows' a Lofty, Beaut @ http://tech.mit.edu/V127/N45/radiohead.html
pogue wrote:Just wanted to make you aware of those. Thanks as usual!
pogue
Indeed, fixing issues is the #1 priority. I just felt I should explain a few things so that your not alarmed when these "bugs" aren't completely fixed, as for the most part these are "features".. heh

Expect the new version either today (with "spell:" left as an English only token for the moment) or tomorrow (with some clever symbol or something used to replace the English "spell:").
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

cg wrote:I do wonder if its getting confused up with the iGoogle section of the page, as my workstation defaults to that and I don't recall ever asking it to :\
i'm in NZ, which google.com redirects to google.co.nz.

Cheers,
cg.
Use the proxy system within the config section to set them apart.

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 ""
Once you add a working proxy here, it may also be blocked for some reason from google. So using a variety and checking the differences may be necessary, but this should solve your issue.
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

#   .9x: Corrected google "spell" to always return results or   #
#            did-you-mean.                                      #
#        Added "special searches" to google searching.          #
#        Corrected population/public_data searches to use new   #
#            template created for these. Is not given as a google
#            "answer" anymore.                                  #
New version here: Incith:Google v1.9.9x ... have a fun ;)

NOTE: This version leaves the english token "spell:" as the mechanism to control the spell feature. Couldn't think of anything clever, so if anyone has an idea feel free to shout it out. ;P
t
transacid
Voice
Posts: 12
Joined: Wed Aug 08, 2007 2:15 pm
Location: Hamburg / Germany
Contact:

Post by transacid »

i still get

Code: Select all

Tcl error [incith::google::public_message]: can't read "state(body)": no such variable
and no addidional debug.
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

transacid wrote:i still get

Code: Select all

Tcl error [incith::google::public_message]: can't read "state(body)": no such variable
and no addidional debug.
Hmm... Have you made sure that the "use_gzip" option within the config of the script is set to 0 and you've rehash'd your bot? If this doesn't fix it I've got a better idea to check where the problem lies....

This will require you to use one of my other scripts, namely webby. The reason to do this is because webby has a more robust engine to detect problems. All you need to do is source webby right after you've sourced the google script in your eggdrop.conf and rehash. Then .chanset #yourchan +webby and we can begin testing.
# this emulates a "!g barney the dinosaur" but does NOT require a page body.
<speechles> !webby http://www.google.com/search?q=barney%2 ... 3&ie=utf-8 --validate
<sp33chy> Validated: http://www.google.com ( http://www.google.com/search?q=barney%2 ... 3&ie=utf-8 )( 200; text/html; utf-8; 0 bytes )
<sp33chy> Server=gws; Expires=-1; Date=Sun, 17 Jan 2010 16:38:46 GMT; Cache-Control=private, max-age=0
<sp33chy> X-XSS-Protection=0

# this emulates "!g barney the dinosaur" but requires a page body.
<speechles> !webby http://www.google.com/search?q=barney%2 ... 3&ie=utf-8
<sp33chy> barney the dinosaur - Google Search ( http://tinyurl.com/ybf3n4l )( 200; text/html; utf-8; 45166 bytes )

# this emulates giving the first result ( link & description ) but of course, requires the page body.
<speechles> !webby http://www.google.com/search?q=barney%2 ... 3&ie=utf-8 --regexp class=g(?!b).*?<a href="(.+?)".*?>((?!<).+?)</a>--
<sp33chy> regexp: capture1 ( http://images.google.com/images?q=barne ... CBEQsAQwAA )
<sp33chy> regexp: capture2 ( Image results for barney the dinosaur )
Webby works for me above. So try those two exact webby requests I've done above and paste the replies you get exactly as I've done above in my quote.
Last edited by speechles on Sun Jan 17, 2010 12:42 pm, edited 1 time in total.
t
transacid
Voice
Posts: 12
Joined: Wed Aug 08, 2007 2:15 pm
Location: Hamburg / Germany
Contact:

Post by transacid »

speechles wrote:
transacid wrote:i still get

Code: Select all

Tcl error [incith::google::public_message]: can't read "state(body)": no such variable
and no addidional debug.
Hmm... Have you made sure that the "use_gzip" option within the config of the script is set to 0 and you've rehash'd your bot? If this doesn't fix it I've got a better idea to check where the problem lies....

This will require you to use one of my other scripts, namely webby. The reason to do this is because webby has a more robust engine to detect problems. All you need to do is source webby right after you've sourced the google script in your eggdrop.conf and rehash. Then .chanset #yourchan +webby and we can begin testing.
# this emulates "!g barney the dinosaur"
<speechles> !webby http://www.google.com/search?q=barney%2 ... 3&ie=utf-8
<sp33chy> barney the dinosaur - Google Search ( http://tinyurl.com/ybf3n4l )( 200; text/html; utf-8; 45166 bytes )

# this emulates giving the first result ( link & description )
<speechles> !webby http://www.google.com/search?q=barney%2 ... 3&ie=utf-8 --regexp class=g(?!b).*?<a href="(.+?)".*?>((?!<).+?)</a>--
<sp33chy> regexp: capture1 ( http://images.google.com/images?q=barne ... CBEQsAQwAA )
<sp33chy> regexp: capture2 ( Image results for barney the dinosaur )
Webby works for me above. So try those two exact webby requests I've done above and paste the replies you get exactly as I've done above in my quote.
oh sorry, well use_gzip did the trick. Why doesn't gzip compression work?
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

transacid wrote:oh sorry, well use_gzip did the trick. Why doesn't gzip compression work?
I've tested it myself using zlib and verified this does work with all my scripts supporting gzip. The method for Trf I've merely borrowed from scotteh's RSS Syndication script. For some reason he cuts 9 bytes off as a gzip footer, this is obviously wrong. Both zlib and Trf should remove the same 10 byte header and 8 byte footer before unzipping. This has been corrected (and corrected in Webby as well), clearing your web cache and regetting either the script should solve the problem. It should now work correctly for both zlib or Trf and allow either to successfully deflate gzipped replies.

Enjoy.. and have a fun.. ;P

Code: Select all

...snipped from Scotteh's Rss Syndication script...
# remove the 10 byte gzip header and 8 byte footer
set cdata [string range $cdata 10 [expr { [string length $cdata] - 9 } ]]

if {[catch {zip -mode decompress -nowrap 1 $cdata} data] != 0} {
  error $data
}
This is where I borrowed the Trf inflation code. Dunno why he put 8 in the comment and 9 below??! O_o;;??? To strip the eof possibly, but shouldn't this be done after converting from gzip to plaintext? Then you strip the eof off the end of the html seperately if you even care?

Side-Note: If your using the proxy system within the script, (proxy_host/proxy_port) you MUST disable use_gzip by setting it to 0. The header field signifying deflate,gzip is not relayed through most proxies.
Post Reply