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.

incith:google :)

Support & discussion of released scripts, and announcements of new releases.
Post Reply
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

tmyoungjr wrote:any thoughts? using
#-----------------------------------------------------------------------------#
# incith:google v1.8.7c#

with no changes at all to the config file.
The usual cause of this is your bot isn't voiced (+v) and the channel #chat is moderated (+m).

Code: Select all

    proc public_message {nick uhand hand chan input} {
      if {[lsearch -exact [channel info $chan] +google] != -1} {
        # do stuff
      }
That code right there is the strandard straight forward chanset +google detection and indeed this works. I'm gonna assume the cause above is your issue. :roll:
m
madwoota
Halfop
Posts: 53
Joined: Tue Aug 09, 2005 12:27 am

Post by madwoota »

br00 wrote: i've tried fresh clean latest tcl and no difference (using incith:google-1.8.7c at the moment), any help?
The 1.8.7c available here is the exact same version I am running on my bot. I've checked it with diff -u and it finds nothing. Sorry, but, no, I don't have any great ideas. Tried killing & restarting your bot ?

tmyoungjr wrote: in #chat my bot doesn't respond at all and i dont get any errors while watching the terminal, nor in the log.
Run .binds in your bot console, look for the line as per below.
The "Hits" is a counter for how many times the bot has used that bind.

Code: Select all

<|EggDrop|> [12:35] #madwoota# binds 
<|EggDrop|> Command bindings:
<|EggDrop|>   TYPE FLGS     COMMAND              HITS BINDING (TCL)
<|EggDrop|>   pubm -|-      *                     652 incith::google::public_message
Now, run a !g test in #bottest, check .binds again, see that the HITS have gone up. Then do the same in #chat, check the .binds again. If you see the hit counter increment, then you know the bot actually received it and processed it, and providing all went well, probably spewed out some data. I'm guessing you're seeing a network or channel restriction on your bot more than anything (like speechles said above, could just be moderated without +v...).
You could try changing your settings so that the bot responds with a privmsg or privnotice to the public command. This would verify the bot config and script for the channel and show just that channel is blocking.
b
br00
Voice
Posts: 9
Joined: Mon Jun 19, 2006 8:09 am

Post by br00 »

madwoota wrote:Tried killing & restarting your bot ?
yep, nothing but "Sorry, no search results were found." every time, no matter what version i use
frustrating to say the least

gonna run it on a bot on another host, see if that makes any difference :/


edit
hmm, works on bots on another host, seems strange tho, every other site parsing script works ok. gotta live with it i suppose
User avatar
incith
Master
Posts: 275
Joined: Sat Apr 23, 2005 2:16 am
Location: Canada

Post by incith »

Does your site that doesn't work.. perhaps test that you can get to google? Can you use 'lynx' or some such? Try and do a google search from your host that isn't working to make sure google actually works, which is what it sounds like, maybe your one host is blocking google for some reason, or google is blocking them.

It is strange tho.
b
br00
Voice
Posts: 9
Joined: Mon Jun 19, 2006 8:09 am

Post by br00 »

to be honest i have no idea how to use lynx and am pretty sure it's not available to me in any case

is a purely 'eggdrops only' shell from voodoohosting, who until now i've been more than happy with, very reliable

the fact that the script comes up with the standard google 'cant find anything' result does seem like google isn't blocking/being blocked.
t
tmyoungjr
Voice
Posts: 14
Joined: Fri Aug 24, 2007 3:30 pm

Post by tmyoungjr »

speechles wrote:
tmyoungjr wrote:any thoughts? using
#-----------------------------------------------------------------------------#
# incith:google v1.8.7c#

with no changes at all to the config file.
The usual cause of this is your bot isn't voiced (+v) and the channel #chat is moderated (+m).

Code: Select all

    proc public_message {nick uhand hand chan input} {
      if {[lsearch -exact [channel info $chan] +google] != -1} {
        # do stuff
      }
That code right there is the strandard straight forward chanset +google detection and indeed this works. I'm gonna assume the cause above is your issue. :roll:

i had thought about that - however the particular channel has nothing on it (no +m or +v going on). the interesting thing is it "Just started working" after we lost connectivity for a day or so. once things were back to normal all was well. my only thought is related to your suggestion above. at some point someone was messing with moderation and voicing and the channel was hung up on my bot. he'd respond to anything else (a few scripts i wrote, etc) but the !google one. for now all works.
b
budsmokr
Voice
Posts: 2
Joined: Wed Jun 08, 2005 10:27 pm

Post by budsmokr »

I also have recently been getting "Sorry, no search results were found." for any google search. The only google search function that works is the image search. All other searches give the no search results were found response, and google fight gives a tie every time 0 to 0.

This has been ongoing for about a month now. The fact that I can get image search results and the fact that I can ping www.google.com from my host suggest there isn't any sort of blocking going on that I can tell.

Nor am I on the same shell provider that Br00 is on.

Strange indeed.
m
madwoota
Halfop
Posts: 53
Joined: Tue Aug 09, 2005 12:27 am

Post by madwoota »

I'm beginning to wonder if its not a local google thing.

Where are you ? Do you get redirected to somewhere *other* than www.google.com if you just type www.google.com in your browser ? Whats your 'native' google.com.* ?

The bot should specifically be going to just google.com/search, but perhaps some local sites (like google.com.ar or something) are not working.
b
budsmokr
Voice
Posts: 2
Joined: Wed Jun 08, 2005 10:27 pm

Post by budsmokr »

I am located in Canada. On my local browser, I get redirected to www.google.ca

My shell however, is located in California. By default, I would think that it would default to www.google.com, but I have no way of testing that out that I can think of, as I don't have access to lynx or any other type of browser. If you can think of a way for me to test for sure via my shell from a command line, let me know.

But I think it is a safe assumption it would be going directly to www.google.com, being in California.
b
br00
Voice
Posts: 9
Joined: Mon Jun 19, 2006 8:09 am

Post by br00 »

same here regarding shell, is in the US so google.com should work fine
pinging www.google.com also works fine

i do know another bot on the same hosts that is having the exact same problem (actually that and budsmokr also having the exact same problem makes me feel a bit better in that it's not just my egg, lol)

it's almost like google itself has blocked searches from some hosts?

whatever it is, it's weird
e
esycat
Voice
Posts: 1
Joined: Sun Oct 28, 2007 6:27 am
Location: Sydney, NSW, Australia
Contact:

Post by esycat »

RFE: !time or !gt command for "time in" queries (for instance, time in moscow).

Thanks to incith and madwoota for perfect script. :-)
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

esycat wrote:RFE: !time or !gt command for "time in" queries (for instance, time in moscow).
It seems silly to dedicate a stand alone trigger to that. You can easily add this proc below into the script, add it directly above ( # define: ). You can then have the script give time within the results using !google time requests....

Code: Select all

        # time:
        } elseif {[string match "*src=http://www.google.com/chart?chs*alt="Clock"*" $html] == 1} {
          if {![regexp -- {alt="Clock"></td><td valign=top>(.+?)<br>} $html - desc]} {
            regexp -- {alt="Clock"></td><td valign=middle>(.+?)</td>} $html - desc
          }
          regsub -- {alt="Clock"} $html {} html
          set link ""
r
rpope904
Voice
Posts: 16
Joined: Sat Feb 02, 2008 7:41 pm

Post by rpope904 »

I am trying to configure it to search google on a specific site for results, the site is forums.x10hosting.com - i've _kinda_ got it to work, but it only returns one result, and displays a sign in link to google... Example below:

[18:25] <&rpope904> !search asp
[18:25] <&x10Helper> Sign in @ https://www.google.com/accounts/Login?c ... ?as_sitese arch=forums.x10hosting.com&hl=en&q=asp&safe=off&btnG=Search&lr=lang_en&hl=en
[18:25] <&x10Helper> http://forums.x10hosting.com/tutorials/ ... t-ssl.html

How can I change this to remove the sign in info, and also maybe display some more results? I am using v1.8.6a and modified the code here to make it search that site only:

"http://www.google.com/search?as_sitesea ... fine_input}"
b
bigpresh
Voice
Posts: 2
Joined: Mon Feb 04, 2008 7:55 pm
Contact:

Post by bigpresh »

rpope904 wrote:I am trying to configure it to search google on a specific site for results, the site is forums.x10hosting.com - i've _kinda_ got it to work, but it only returns one result, and displays a sign in link to google... Example below:

[18:25] <&rpope904> !search asp
[18:25] <&x10Helper> Sign in @ https://www.google.com/accounts/Login?c ... ?as_sitese arch=forums.x10hosting.com&hl=en&q=asp&safe=off&btnG=Search&lr=lang_en&hl=en
[18:25] <&x10Helper> http://forums.x10hosting.com/tutorials/ ... t-ssl.html
Yeah, I'm getting the same issue - presumably Google have changed their page layout slightly. I haven't had a chance to take a proper look but I guess it should be pretty simple to tweak the script to ignore login links.
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

bigpresh wrote:
rpope904 wrote:I am trying to configure it to search google on a specific site for results, the site is forums.x10hosting.com - i've _kinda_ got it to work, but it only returns one result, and displays a sign in link to google... Example below:

[18:25] <&rpope904> !search asp
[18:25] <&x10Helper> Sign in @ https://www.google.com/accounts/Login?c ... ?as_sitese arch=forums.x10hosting.com&hl=en&q=asp&safe=off&btnG=Search&lr=lang_en&hl=en
[18:25] <&x10Helper> http://forums.x10hosting.com/tutorials/ ... t-ssl.html
Yeah, I'm getting the same issue - presumably Google have changed their page layout slightly. I haven't had a chance to take a proper look but I guess it should be pretty simple to tweak the script to ignore login links.
Change line 462 & 463 from this:

Code: Select all

          regexp -- {<div class=g>.*?<a.*?href="(.+?)".*?>(.+?)</a>} $html - link desc
          regsub -- {<div class=g>.*?<a.*?href="(.+?)".*?>(.+?)</a>} $html {} html
Change line 462 & 463 to this:

Code: Select all

          regexp -- {<div class=g(?!b).*?<a href="(.+?)".*?>((?!<).+?)</a>} $html - link desc
          regsub -- {<div class=g(?!b).*?<a href="(.+?)".*?>(.+?)</a>} $html {} html
Now I know for a fact this works. You can also try my UNOFFICIAL incith-google 1.9.8 which allows for multilingual abilities, properly encoding/decoding queries, as well as numerous other features/sites included.
Post Reply