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.
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:").