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
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

iNFERNiS wrote:hmm, google is not working for me at all, no response. Most of the other things work though.

Code: Select all

    # set this to the default country you would like *.google.* sites to use when
    # no country is specified. default is "com". country is google extension.
    # http://google.*/ - co.uk, de, es, com, com.au, these are examples.
    # ------
    variable google_country "com" 

    # Channel filter
    # this is for users who already have a google script running, but would
    # like to use the other functions of this script. You can filter out google
    # requests in any of the channels listed below.
    # default is "". To add them use: "#chan1 #CHAN2 #cHaN3 #EtC", case is irrelevant.
    # ------
    variable filtered ""
Assuming you left google as "com" defaulted. The problem is more than likely your filtering google from working. You should only use the channel filter on channels you want google NOT working in. If you want it working in every channel you have set +google leave it as "".

EDit: New version, 1.9.8b... Yay! Corrects a few parsing issues with youtube as well as a major rehaul for translations which now includes html markup transcoding (with help from perplexa's urban dictionary script). Other minor fixes not worth mentioning included as well. enjoy 8)
c
cruxing
Voice
Posts: 9
Joined: Wed Sep 05, 2007 1:56 am

Post by cruxing »

iNFERNiS wrote:hmm, google is not working for me at all, no response. Most of the other things work though.
I am having the same issue, and I can't nail it down. Basically every non-!google search seems to work flawlessly.

Actually, upon testing just now, it appears that every single other one does work.

Additionally, !g movie:blah and define:blah work, but spell:blah does not.

I just installed a fresh copy of the latest one (1.98b), with no modifications. +google is clearly set because everything else is working, and I'm not seeing any error messaging.

What is baffling me is that it USED to work, a few versions ago, and then suddenly stopped. I'm not sure if it can be a dependency thing, since everything else is working? I really have no idea, my ability is rudimentary at best and at this point this script is way beyond me... heh

I disabled all other scripts as well, just to see, and it does persist.

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

Post by speechles »

To help pinpoint the problem, because for me everything works.

What you can do, is enable set and tcl commands in your eggdrop.conf and log into your bots partyline and issue a .rehash. Then type !google anything in your main channel and trigger the script. If you get no response, immediately swap to your bots partyline window and type .set errorInfo (case does matter, the I must be uppercase, type it exactly as I have). Then paste the results given from your bot and hopefully with that I can begin to understand how your eggdrop is behaving differently than mine.
c
cruxing
Voice
Posts: 9
Joined: Wed Sep 05, 2007 1:56 am

Post by cruxing »

I am mildly shamed that I didn't even know that command existed... learn something new I suppose!

Here you go:

[23:33] <botbot> [02:33] #crux# set errorInfo
[23:33] <botbot> Currently: can't read "state(after)": no such element in array
[23:33] <botbot> Currently: while executing
[23:33] <botbot> Currently: "after cancel $state(after)"
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

cruxing wrote:I am mildly shamed that I didn't even know that command existed... learn something new I suppose!

Here you go:

[23:33] <botbot> [02:33] #crux# set errorInfo
[23:33] <botbot> Currently: can't read "state(after)": no such element in array
[23:33] <botbot> Currently: while executing
[23:33] <botbot> Currently: "after cancel $state(after)"
That indicates the script did not have an error, instead came up with no scraped information to display (extremely rare on well maintained scripts). It's most likely a regional problem with google. What country are you located? With that info I can attempt to recreate the html given to the bot. Once I have that html the script is unable to parse, it will once again parse it.

*** Note: Try changing the google country to your countries TLD instead of using "com" and see if your own regional server works. If a regional server does but "com" does not, please post about it here.
c
cruxing
Voice
Posts: 9
Joined: Wed Sep 05, 2007 1:56 am

Post by cruxing »

The shell is located in Canada, and changing between ca and com for google_country seems to make no discernible difference.

Attempting any of the google variations (.co.uk) etc all seem to result in the same behavior.

I am relatively certain this is due to some oddness going on with my shell host but I cannot fathom what. I mean, clearly the script is working for 99% of the users otherwise there'd be more than just me and one other person making any mention of difficulty.
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

cruxing wrote:TAttempting any of the google variations (.co.uk)
You do realize the correct way to add them is without the leading dot (.) right? So if we were to add .co.uk it would be added as "co.uk", .com.au as "com.au". All variables similar to this need their leading dots removed. I'm sure you understand this otherwise you would have gotten a script generated socket error message asking if it exited. I'm stumped as to what the cause is.
c
cruxing
Voice
Posts: 9
Joined: Wed Sep 05, 2007 1:56 am

Post by cruxing »

Yeah I figured that out during earlier trial and error.

Ah, well. Guess I'll bug my shell admins and see if they've got any bright ideas, maybe I can get someone else on the same machine to test the script, to at least try and nail down if it's some weird configuration problem with the machine.

It (the shell, that is) definitely is pulling up a canadian locale though, as even going through links to www.google.com is ending me up at google.ca.

edit: Ok, I may have figured something out, going to bed now though. It is definitely an issue on the shell side... will let you know. Thanks for your patience/help though, it is much appreciated!
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

The way the script crafts it's url query string is different from how just going to www.google.com is. The query string presently in use should always lead to each regional server.

Code: Select all

set query "http://www.google.${country}/search?q=${input}&safe=${incith::google::safe_search}&btnG=Search&lr=lang_${incith::google::language}&num=10"
<speechles> !g .ca anything
<sp33chy> 639,000,000 Results | aNYthing @ http://www.anewyorkthing.com/ | the aNYthing score @ http://www.anewyorkthing.com/store/ | Do you want Anything or Whatever? @ http://www.anything.com.sg/ | YouTube - Building Stonehenge - This Man @ http://www.youtube.com/watch?v=lRRDzFROMx0
<speechles> !g .com anything
<sp33chy> 691,000,000 Results | aNYthing @ http://www.anewyorkthing.com/ | the aNYthing score @ http://www.anewyorkthing.com/store/ | Do you want Anything or Whatever? @ http://www.anything.com.sg/ | Jay-Z - Anything @ http://www.youtube.com/watch?v=swUbRa_ijVw
<speechles> !g .fr anything
<sp33chy> 643 000 000 Résultats | aNYthing @ http://www.anewyorkthing.com/ | Anything else, la vie et tout le reste @ http://www.allocine.fr/film/fichefilm_g ... 46729.html | aNYthing glob @ http://glob.anewyorkthing.com/ | Do you want Anything or Whatever? @ http://www.anything.com.sg/
<speechles> !g .de anything
<sp33chy> 640.000.000 Ergebnisse | aNYthing @ http://www.anewyorkthing.com/ | something, anything, somone, anyone, s @ http://www.englisch-hilfen.de/exercises ... ything.htm | Do you want Anything or Whatever? @ http://www.anything.com.sg/ | Anything Goes - Wikipedia @ http://de.wikipedia.org/wiki/Anything_Goes
You can tell it's doing it correctly by the differing results and discrepancy in totals. Try testing google dynamically with !google .anything <search terms> replacing anything with each TLD possible for google.

...and before I forget...If you put anything over 10 for search_results, you may also get no results. The MAX they allow displayed per page is 10 and the bot is hardcoded to fetch said number always. You can pick anything 10 or less and suffer no worries.

EDit: [mar 18th] 1.9.8b link updated: added preliminary html transcoding, this makes it childs play to remove html characteristics from text, making it even closer to browser like behavior.

Code: Select all

    # Description Decode 
    # convert html codes into characters - credit perplexa (urban dictionary)
    #
    proc descdecode {text} {
      # code below is neccessary to prevent numerous html markups
      # from appearing in the output (ie, ", ᘧ, etc)
      # stolen (borrowed is a better term) from perplexa's urban
      # dictionary script..

      set escapes {
          \x20 " \x22 & \x26 &apos; \x27 – \x2D
        < \x3C > \x3E ˜ \x7E € \x80 ¡ \xA1
        ¢ \xA2 £ \xA3 ¤ \xA4 ¥ \xA5 ¦ \xA6
        § \xA7 ¨ \xA8 © \xA9 ª \xAA « \xAB
        ¬ \xAC ­ \xAD ® \xAE &hibar; \xAF ° \xB0
        ± \xB1 ² \xB2 ³ \xB3 ´ \xB4 µ \xB5
        ¶ \xB6 · \xB7 ¸ \xB8 ¹ \xB9 º \xBA
        » \xBB ¼ \xBC ½ \xBD ¾ \xBE ¿ \xBF
        À \xC0 Á \xC1 Â \xC2 Ã \xC3 Ä \xC4
        Å \xC5 Æ \xC6 Ç \xC7 È \xC8 É \xC9
        Ê \xCA Ë \xCB Ì \xCC Í \xCD Î \xCE
        Ï \xCF Ð \xD0 Ñ \xD1 Ò \xD2 Ó \xD3
        Ô \xD4 Õ \xD5 Ö \xD6 × \xD7 Ø \xD8
        Ù \xD9 Ú \xDA Û \xDB Ü \xDC Ý \xDD
        Þ \xDE ß \xDF à \xE0 á \xE1 â \xE2
        ã \xE3 ä \xE4 å \xE5 æ \xE6 ç \xE7
        è \xE8 é \xE9 ê \xEA ë \xEB ì \xEC
        í \xED î \xEE ï \xEF ð \xF0 ñ \xF1
        ò \xF2 ó \xF3 ô \xF4 õ \xF5 ö \xF6
        ÷ \xF7 ø \xF8 ù \xF9 ú \xFA û \xFB
        ü \xFC ý \xFD þ \xFE ÿ \xFF
      };
      set text [string map $escapes $text]
      # tcl filter required because we are using SUBST command below
      # this will escape any sequence which could potentially trigger
      # the interpreter..
        regsub -all -- \\\\ $text \\\\\\\\ text
        regsub -all -- \\\[ $text \\\\\[ text
        regsub -all -- \\\] $text \\\\\] text
        regsub -all -- \\\} $text \\\\\} text
        regsub -all -- \\\{ $text \\\\\{ text
        regsub -all -- \\\" $text \\\\\" text
      # end tcl filter
      regsub -all -- {&#([[:digit:]]{1,5});} $text {[format %c [string trimleft "\1" "0"]]} text
      regsub -all -- {&#x([[:xdigit:]]{1,4});} $text {[format %c [scan "\1" %x]]} text
      regsub -all -- {&#?[[:alnum:]]{2,7};} $text "?" text
      return [subst $text]
    }
Take for example, a description containing this: "this&#32;text"
With html transcoding , it will now look like this: "this text"

Which is how a real browser would display it. Credit for this addition goes entirely to perplexa, most of it ripped (borrowed) from his urban dictionary script. Some of it modified by me to eliminate the need to strip characters into nulls, so all characters can be displayed. Preliminary support for this added to translation, wikipedia, wikimedia.. Entire script will support it shortly, this is just an update to those who follow the thread closely. ;)

Get it at any v1.9.8b link above and enjoy :P
Last edited by speechles on Fri Apr 04, 2008 1:43 pm, edited 2 times in total.
Z
Zircon
Op
Posts: 191
Joined: Mon Aug 21, 2006 4:22 am
Location: Montreal

Post by Zircon »

Hello Speechles

first thanks a lot for this very nice script. Lately i made an update to the last version. But i m a having a little problem with !wiki. In the script, i have :

variable wiki_country "fr"

Here is an example :
<Zircon> !wiki mont mckinley
<Anti-Flood> Wikimedia Error: Unable to parse for: mont%20mckinley @ http://fr.wikipedia.org/wiki/index.php? ... ext=Search
Altought the link http://fr.wikipedia.org/wiki/Mont_McKinley

Even looking with Mont_Mckinly didnt work:
<Zircon> !wiki mont_mckinley
<Anti-Flood> Wikimedia Error: Unable to parse for: mont%20mckinley @ http://fr.wikipedia.org/wiki/index.php? ... ext=Search
Is this normal ?
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

Zircon wrote:Is this normal ?
No. it is abnormal behavior. I've since fixed this problem if you reget the script.
<speechles> !wiki mont mckinley
<sp33chy> Mont McKinley | Le mont McKinley ou Denali en langue locale est la plus haute montagne d'Amérique du Nord. Situé au centre de l'Alaska, aux États-Unis, il culmine à 6 194 mètres au-dessus du niveau de la mer. Son altitude, son climat extrême et sa situation géographique arctique en font un des sommets les plus difficiles à escalader au monde et ce n'est qu'en 1913 que la montagne fut pour la première
<sp33chy> fois vaincue par l'homme. Depuis 1917, la montagne fait partie intégrante de la zone protégée du parc national de Denali. @ http://fr.wikipedia.org/wiki/Mont_McKinley
The problem stemmed from recent wikipedia changes. I've corrected the script to now use a scraping method similar to how wikimedia does. This should make future maintenance uneeded, at least regarding wikipedia/wikimedia. Get the new fixed script HERE or at any v1.9.8b link found above.
d
djevrek
Voice
Posts: 11
Joined: Tue Jul 31, 2007 4:05 am

Google whois

Post by djevrek »

Hey, GOOGLE has just revived whois feature for domain lookups. Just type whois domain.com and first result is simple whois of domain registration.
I was wonder, can you add this feature to your script too. If i type just !g whois domain.com it will give me link to whois that google offer, not result and info from google search site.

More info on blog here: http://feeds.feedburner.com/~r/Googlified/~3/273185113/
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Re: Google whois

Post by speechles »

djevrek wrote:Hey, GOOGLE has just revived whois feature for domain lookups. Just type whois domain.com and first result is simple whois of domain registration.
I was wonder, can you add this feature to your script too. If i type just !g whois domain.com it will give me link to whois that google offer, not result and info from google search site.

More info on blog here: http://feeds.feedburner.com/~r/Googlified/~3/273185113/
http://googlesystem.blogspot.com/2008/0 ... nebox.html
This was just added back yesterday, Friday, April 18, 2008.

Also, the way you describe your wish, I believe it already works this way.
<speechles> !g whois google
<sp33chy> 750,000 Results | Google.com - gOOgLE @ http://whois.domaintools.com/google.com | Google WHOIS OneBox @ http://googlesystem.blogspot.com/2008/0 ... nebox.html | Google Whois Search @ http://www.markcarey.com/googleguy-says ... earch.html | Wendy’s Blog: Legal Tags » Whois google @ http://wendy.seltzer.org/blog/archives/ ... lecom.html
Notice, the 1st result doesn't contain the extra info from google about the domain though? That's because that onebox isn't caught and the regular search parser is handling it. I'll fix this shortly so the info line is given on irc as well. I've also got to fix the semi-broken video which works for any country EXCEPT .com which has changed recently. I'll fix that up and add that new whois onebox shortly (perhaps tonight :wink:)
d
djevrek
Voice
Posts: 11
Joined: Tue Jul 31, 2007 4:05 am

Post by djevrek »

Well, i know that, but i want that little info about expire and register day. And maybe add something like !g whois: domain.com to shows us just that info, not other stuff from web search. Thanks
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

djevrek wrote:Well, i know that, but i want that little info about expire and register day. And maybe add something like !g whois: domain.com to shows us just that info, not other stuff from web search. Thanks
Just that? There exist a plethora of whois domain scripts to use in that case.

When I incorporate this into the script, it will work using only the information google scrapes and displays in the onebox. It would also show the other results as well because this is a google script, not simply a whois script. The intention and soul of the script is to behave exactly as google does with all the good, bad and ugly intact (zero learning curve for users, it works exactly like google does). I might allow some option in the config so admins can bastardize this behavior and force it to return only the one result when dealing with onebox whois replies.

Edit: Since I'm in the emerald triangle, and today being april 20th, I might not get to these issues until sometime later this week. Frisbee golf, bongs and birdies.. yay!!
Post Reply