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
m
madwoota
Halfop
Posts: 53
Joined: Tue Aug 09, 2005 12:27 am

Post by madwoota »

Ok, I've provided an interim fix for this, but I wont be uploading it to the egghelp tcl archive just yet as I have a few others things to fix up before I do that first.

So, here's a temporary fix that will stop the script mangling the search parameters and allow you to search for stuff in quotes.

Ie: if you want to search for an IP directly, you need to enclose it in quotes like so: (as per googles own functionality)

Code: Select all

!g "xxx.xxx.xxx.xxx"
Note: if this breaks anything else, please let me know as I havent had a chance to run a full set of regression testing through it.

Get it here:
Edit: removed, see below.
m
madwoota
Halfop
Posts: 53
Joined: Tue Aug 09, 2005 12:27 am

Post by madwoota »

Well isnt that just typical. As soon as I fix one thing, Google go and change their source on me !

So, I've fixed that AND changed the regex structure quite a lot to attempt to cope with future google changes.

Hopefully this will hold us over until the next version in (probably) a couple weeks with a large code cleanup and a few new features :)

Anyway, heres another interim release (1.7.2) to fix up the broken results the script is now returning.

Get it here:
http://www.woota.net/~madwoota/incith-g ... ent.tar.gz

Note: I will now keep a single link (above) and just update the script as new releases come about so you can just use that :)

regards,
-madwoota
S
SkiZm
Voice
Posts: 4
Joined: Thu Nov 24, 2005 10:11 pm

Post by SkiZm »

madwoota wrote:Well isnt that just typical. As soon as I fix one thing, Google go and change their source on me !

So, I've fixed that AND changed the regex structure quite a lot to attempt to cope with future google changes.

Hopefully this will hold us over until the next version in (probably) a couple weeks with a large code cleanup and a few new features :)

Anyway, heres another interim release (1.7.2) to fix up the broken results the script is now returning.

Get it here:
http://www.woota.net/~madwoota/incith-g ... ent.tar.gz

Note: I will now keep a single link (above) and just update the script as new releases come about so you can just use that :)

regards,
-madwoota

Thanks for the quick update.

I noticed that the GROUPS search was not working, so I did a test and put some of the old code back in from 1.7. It then worked fine.

Code: Select all

while {$results < $incith::google::group_results} {
        #regexp -- {<td.+?style=.+?width.+?/group/(.+?)/browse_thread/thread/(.+?)/.+?">(.+?)</a>} $html {} group thread desc
        #regsub -- {<td.+?/group/.+?</a>} $html {} html
        regexp -- {<td style="width:(?:.+?)/group/(.+?)/browse_thread/thread/(.+?)/(?:.+?)">(.+?)</a>} $html {} group thread desc
        regsub -- {<td style="width:(.+?)</a>} $html {} html

Hope this helps and thanks again for a quick update.
m
madwoota
Halfop
Posts: 53
Joined: Tue Aug 09, 2005 12:27 am

Post by madwoota »

Thats what you get for being too tricky :)
The problem occurs when you get a "groups matching" result as well.

I fixed with a compromise from the old style to the new way.

I'll revisit this later to clean it up.

So, 1.7.3 is Here
a
astrali
Voice
Posts: 2
Joined: Fri Nov 25, 2005 7:28 pm
Location: Germany

Post by astrali »

hi madwoota!
first thx for the fast updates :D

my problem is: i always get reply's with a -translation- link like that

Code: Select all

<Astrali> !g incith google

<munchBOT> Translate this page @ http://translate.google.com/translate?hl=en&sl=de&u=http://213.133.100.121/index.php?iCurrentItemId=1&iNewsItemId=7&prev=/search?q=incith+google&hl=en&lr=&ie=UTF-8&safe=off&sa=G class=fl | Translate this page @ http://translate.google.com/translate?hl=en&sl=de&u=http://www.shellfire.de/index.php?iCurrentItemId=1345&prev=/search?q=incith+google&hl=en&lr=&ie=UTF-8&safe=off&sa=G class=fl 
the server the eggdrop is running on is in germany .. maybe thats the problem?
my language setting is standard value (all) cause most used language in the channels is english

would be nice to get a reply how to fix this problem :)
got the latest version from your server.

Greetz, Astrali
m
madwoota
Halfop
Posts: 53
Joined: Tue Aug 09, 2005 12:27 am

Post by madwoota »

I was wondering when this issue was going to pop up.
Its caused because Google automatically forwards you on to your local google server based on the host you connect to it from.

Because your server is in germany, Google (thoughtfully) sends you on to google.de, however since most of your query results are in English, Google thinks you will probably want to translate them back to German and gives you lots of those results.

However, the query string used to ask Google for the results was *supposed* to have avoided this situation by using google.com only and not using any local Google servers (although I did consider that at one stage).

I have some theories on avoiding this, so I'll check it out and let you know.
a
astrali
Voice
Posts: 2
Joined: Fri Nov 25, 2005 7:28 pm
Location: Germany

Post by astrali »

many thx :D

would be nice if u were able tro fix it!
btw this is the best google script ever.

Greetz, Astrali
R
RockydotNet
Voice
Posts: 1
Joined: Mon Nov 28, 2005 11:29 pm

Op and/or Voice only

Post by RockydotNet »

You know what would be nice? If the script had the option to only work for users that are +o and/or +v.

Love the script otherwise. :D
m
madwoota
Halfop
Posts: 53
Joined: Tue Aug 09, 2005 12:27 am

Re: Op and/or Voice only

Post by madwoota »

RockydotNet wrote:You know what would be nice? If the script had the option to only work for users that are +o and/or +v.
Presuming you have all of your +o and +v users registered on your bot, you can do this already.
Change the "bind pubm -|-" to "bind pubm -|ov" and .rehash will use the bots internal user flag matching to ensure they have the +o or v flags on that channel.
Course, it *only* works if they're all known by the bot.

You probably actually mean any +v/o without them having to be known on the bot though, so that wouldnt work and I'd have to add something for it :)
t
testebr
Halfop
Posts: 86
Joined: Thu Dec 01, 2005 12:22 pm

Post by testebr »

I have a problem...

I run this tcl in windrop.

!video << work fine..

!news << work fine..

!images << work fine..

!google << the problem is: Tcl error [incith:google]: can't read "line": no such variable

Any solution for this little problem?

My version:
incith:google v1.7.3
m
madwoota
Halfop
Posts: 53
Joined: Tue Aug 09, 2005 12:27 am

Post by madwoota »

testebr wrote:!google << the problem is: Tcl error [incith:google]: can't read "line": no such variable
As far as I can tell from an initial gloss over, the only way you would be getting that result is if the main google function itself returned absolutely no data at all.
But a part of the function ensures that it would, since thats how you get "No search results found."

Can you provide a little more info ? Eggdrop version, tcl version, country you're in, something that you've searched for that doesnt work etc.
t
testebr
Halfop
Posts: 86
Joined: Thu Dec 01, 2005 12:22 pm

Post by testebr »

Sure, my config:

Code: Select all

#package require http 2.4
source lib/tcl8.4/http2.5/http.tcl
setudef flag google

# 0 will typically disable an option, otherwise a value 1 or
# above will enable it.
#
namespace eval incith {
  namespace eval google {
    # set this to the command character you want to use for the binds
    variable command_char "!"

    # set these to your preferred binds ("one two" - space delimited!)
    variable google_binds "g google"
    variable image_binds "gi image images i"
    variable local_binds "gl local"
    variable group_binds "gg group groups"
    variable news_binds "gn news"
    variable print_binds "gp print"
    variable video_binds "gv video"

    # if you want to allow users to search via private /msg, enable this
    variable private_messages 0

    # as per emailed & forum requests, use the next two variables together
    # to determine the output type like so:
    #  notice_reply 1 & force_private 1 = private notice reply only (this is as requested)
    #  notice_reply 0 & force_private 1 = private msg reply only
    #  notice_reply 1 & force_private 0 = regular channel OR private NOTICE
    #  notice_reply 0 & force_private 0 = regular channel OR private MSG (default)

    # set to 1 to enable a /notice reply instead, 0 for normal text
    variable notice_reply 0
    # set to 1 to force all replies to be private
    variable force_private 0


    # set this to the language you want results in! use 2 letter form.
    #   "all" is the default/standard google.com search.
    #   See http://www.google.com/advanced_search for a list.  You have to use
    #   the 'Language' dropdown box, perform a search, and find a line in the URL
    #   that looks like "&lr=lang_en" (for English). "en" is your language code.
    # Popular Ones: it (italian), da (danish), de (german), es (spanish), fr (french)
    # please note, this does not 'translate', it searches Google in a
    #   language of choice, which means you can still get English results.
    variable language "all"

    # number of search results/image links to return, 'define:' is always 1 as some defs are huge
    variable search_results 4
    variable image_results 4
    variable local_results 4
    variable group_results 3
    variable news_results 3
    variable print_results 4
    variable video_results 4

    # what to use to seperate results, set this to "\n" and it will output each result
    #   on a line of its own. the seperator will be removed from the end of the last result.
    variable seperator " | "

    # ** this is not an optional setting, if a string is too long to send, it won't be sent! **
    # It should be set to the max amount of characters that will be received in a public
    #   message by your IRC server.  If you find you aren't receiving results, try lowering this.
    variable split_length 443

    # trimmed length of returned descriptions, only for standard searches.
    variable description_length 21

    # replace search terms appearing in the description as bolded words?
    variable bold_descriptions 1

    # underline links returned from search results?
    variable underline_links 0

    # number of minute(s) to ignore flooders, 0 to disable flood protection
    variable ignore 1

    # how many requests in how many seconds is considered flooding?
    # by default, this allows 3 queries in 10 seconds, the 4th being ignored
    #   and ignoring the flooder for 'variable ignore' minutes
    variable flood 4:10
  }
}

# end of configuration, script begins
I'm from Brazil and use Windrop latest version in Windows XP Sp2 and tcl version incith:google v1.7.3

Want more some info?

Thanks for help
t
testebr
Halfop
Posts: 86
Joined: Thu Dec 01, 2005 12:22 pm

Post by testebr »

My problem continues...
Tcl error [incith:google]: can't read "line": no such variable
D
Digerati
Voice
Posts: 2
Joined: Mon Dec 05, 2005 3:42 am

Post by Digerati »

When I do:

Code: Select all

!google continuum
I get the following results:
<dBot> The Continuum International Publishing @ http://www.continuumbooks.com/
<dBot> STARTREK.COM @ http://www.startrek.com/
<dBot> Welcome to Continuum, Inc. @ http://www.continuumlasers.com/
<dBot> Subspace Continuum - Freeware Game @ /url?sa=X&revid=1782563160&qpos=0&upos=0&oi=revisions_inline&q=http://beginners.subspace.net/%20
It seems like the reason this happens is because of the "See results for:" addition that Google has at http://www.google.com/search?q=continuum after the third result. Can you please fix the script to work around this? :)
m
madwoota
Halfop
Posts: 53
Joined: Tue Aug 09, 2005 12:27 am

Post by madwoota »

Hi all, I havent forgotten about you :)

I had some things to take care of this past week/weekend - namely moving everything out of my house and back in, moving my *entire* computer room from one end of the house ot the other, re-wire the whole house for cat5/tv/cable/etc.

Just look around your dungeon and imagine having to move ALL of it :!:

I will be getting back into checking out these things this week and I'll keep you all posted.

regards,
-madwoota
Post Reply