Hello everyone,
a friend just told me that Babylon Translator now offers a glossary that's connected to Wikipedia.
This means that you just have to middle-click any word or phrase and Babylon will display the respective Wikipedia article:
So I thought, why spend 50 $ on Babylon; this can be done with AHK as well - or can it?
Here's what I think the program should do:[*:gn6am669]First, middle-clicking a word or phrase marks it as the keyword to look for. This means there needs to be a way to somehow recognize the text under the mouse pointer.
(I've considered using copy & paste for this - mark the phrase, then middle-click to copy the word/phrase to the clipboard - but not all programs use the same hotkey for that... )
[*:gn6am669]Then, the appropriate URL is composed (e.g. http://en.wikipedia.org/wiki/%keyword%).*
[*:gn6am669]Finally, the contents of that website (or part of it) should be displayed in a small window (similiar to that screenshot above). Opening the URL in the web browser would pretty much obviate the need for a program like this.
However, writing a HTML parser is obviously not an option - maybe the existing IE rendering engine could be used (never done that before)? Otherwise, all the HTML tags would have to be stripped and the contents displayed as plain text...* This means that not only Wikipedia, but any website with the keyword(s) in the URL could be accessed (cf. Firefox's quick searches)!?
Sounds like a good idea? Any suggestions on how to best translate this idea into AHK code? (I'm currently working on a little proof-of-concept script to see what can and can't be done - and how much effort it'd require.)
btw: I hope there aren't any copyright issues in accessing a website like that!?
PS: What would be a good name for such a script/program? I've thought of something like Information@click, but that's a little too corny I guess...
Wikipedia @ click?
Started by
Ace_NoOne
, Jan 08 2006 02:53 PM
4 replies to this topic
#1
-
Posted 08 January 2006 - 02:53 PM
This checks up any word under the mouse cursor with Answers.com (it only works if text can be highlighted):
MButton:: clipx := clipboard MouseClick, Left, , , 2 Send, ^c Run, http://www.answers.com/main/ntquery?s=%clipboard% clipboard := clipx Return
#2
-
Posted 23 February 2006 - 01:25 AM
autohotkey.com/net Site Manager
Contact me by email (polyethene at autohotkey.net) or message tidbit
Titan, Titan, do you say everything twice, do you say everything twice?
We discussed it a year ago. The client of Answers.com does not use the clipboard, it detects if a longer phrase is selected, it works, when double click does not select text, etc. It probably uses some accesibility tools, and it is quite sophisticated. We can only program a much simpler variant in AHK.
We discussed it a year ago. The client of Answers.com does not use the clipboard, it detects if a longer phrase is selected, it works, when double click does not select text, etc. It probably uses some accesibility tools, and it is quite sophisticated. We can only program a much simpler variant in AHK.
#3
-
Posted 23 February 2006 - 04:05 AM
I think I must've double clicked 'Submit' causing the duplicate post, I apologize
I've checked my script to see if the word under the mouse cursor can be captured with a double click and a Ctrl+c, and it works fine! Try changing the URL in my above script to something like http://google.com/search?q= and you will get the same result in a google search.
I've checked my script to see if the word under the mouse cursor can be captured with a double click and a Ctrl+c, and it works fine! Try changing the URL in my above script to something like http://google.com/search?q= and you will get the same result in a google search.
#4
-
Posted 23 February 2006 - 10:12 AM
autohotkey.com/net Site Manager
Contact me by email (polyethene at autohotkey.net) or message tidbit
Alternative solution (not quite the same as what you are thinking, I know):
use Firefox and its Mycrof extension (integrated in FF 1.5). I have Wikipedia and Merriam-Webster in there. Althought I forget it and click on the M-W button on my personal toolbar :lol:
use Firefox and its Mycrof extension (integrated in FF 1.5). I have Wikipedia and Merriam-Webster in there. Althought I forget it and click on the M-W button on my personal toolbar :lol:
#5
-
Posted 23 February 2006 - 11:33 AM
vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")