| View previous topic :: View next topic |
| Author |
Message |
speechles Revered One

Joined: 26 Aug 2006 Posts: 1398 Location: emerald triangle, california (coastal redwoods)
|
Posted: Tue Mar 11, 2008 2:28 am Post subject: |
|
|
| iNFERNiS wrote: | | hmm, google is not working for me at all, no response. Most of the other things work though. |
| Code: | # 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  |
|
| Back to top |
|
 |
cruxing Voice
Joined: 05 Sep 2007 Posts: 9
|
Posted: Sun Mar 16, 2008 9:30 pm Post subject: |
|
|
| 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? :/ |
|
| Back to top |
|
 |
speechles Revered One

Joined: 26 Aug 2006 Posts: 1398 Location: emerald triangle, california (coastal redwoods)
|
Posted: Mon Mar 17, 2008 12:24 am Post subject: |
|
|
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. |
|
| Back to top |
|
 |
cruxing Voice
Joined: 05 Sep 2007 Posts: 9
|
Posted: Mon Mar 17, 2008 2:35 am Post subject: |
|
|
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)" |
|
| Back to top |
|
 |
speechles Revered One

Joined: 26 Aug 2006 Posts: 1398 Location: emerald triangle, california (coastal redwoods)
|
Posted: Mon Mar 17, 2008 2:48 am Post subject: |
|
|
| 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. |
|
| Back to top |
|
 |
cruxing Voice
Joined: 05 Sep 2007 Posts: 9
|
Posted: Mon Mar 17, 2008 3:25 am Post subject: |
|
|
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. |
|
| Back to top |
|
 |
speechles Revered One

Joined: 26 Aug 2006 Posts: 1398 Location: emerald triangle, california (coastal redwoods)
|
Posted: Mon Mar 17, 2008 3:41 am Post subject: |
|
|
| 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. |
|
| Back to top |
|
 |
cruxing Voice
Joined: 05 Sep 2007 Posts: 9
|
Posted: Mon Mar 17, 2008 3:58 am Post subject: |
|
|
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! |
|
| Back to top |
|
 |
speechles Revered One

Joined: 26 Aug 2006 Posts: 1398 Location: emerald triangle, california (coastal redwoods)
|
Posted: Mon Mar 17, 2008 4:32 am Post subject: |
|
|
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: | | set query "http://www.google.${country}/search?q=${input}&safe=${incith::google::safe_search}&btnG=Search&lr=lang_${incith::google::language}&num=10" |
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: | # 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 ' \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 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 
Last edited by speechles on Fri Apr 04, 2008 1:43 pm; edited 2 times in total |
|
| Back to top |
|
 |
Zircon Op
Joined: 21 Aug 2006 Posts: 191 Location: Montreal
|
Posted: Tue Apr 01, 2008 3:06 am Post subject: |
|
|
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 :
Altought the link http://fr.wikipedia.org/wiki/Mont_McKinley
Even looking with Mont_Mckinly didnt work:
Is this normal ? |
|
| Back to top |
|
 |
speechles Revered One

Joined: 26 Aug 2006 Posts: 1398 Location: emerald triangle, california (coastal redwoods)
|
Posted: Tue Apr 01, 2008 11:47 am Post subject: |
|
|
| Zircon wrote: | | Is this normal ? |
No. it is abnormal behavior. I've since fixed this problem if you reget the script. | Quote: | <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. |
|
| Back to top |
|
 |
djevrek Voice
Joined: 31 Jul 2007 Posts: 11
|
Posted: Sat Apr 19, 2008 5:55 am Post subject: Google whois |
|
|
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/ |
|
| Back to top |
|
 |
speechles Revered One

Joined: 26 Aug 2006 Posts: 1398 Location: emerald triangle, california (coastal redwoods)
|
Posted: Sat Apr 19, 2008 10:03 am Post subject: Re: Google whois |
|
|
| 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/04/google-whois-onebox.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.
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 ) |
|
| Back to top |
|
 |
djevrek Voice
Joined: 31 Jul 2007 Posts: 11
|
Posted: Sat Apr 19, 2008 10:52 am Post subject: |
|
|
| 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 |
|
| Back to top |
|
 |
speechles Revered One

Joined: 26 Aug 2006 Posts: 1398 Location: emerald triangle, california (coastal redwoods)
|
Posted: Sat Apr 19, 2008 11:19 am Post subject: |
|
|
| 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!! |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|