Hi,
realy cool
I will use this website instead
I have also tried to write my own script (for comparative reasons, so that we can learn from each other) and here it is:
function doQuery(querykey,querynokeyword){
var output="";
var url = "http://ninjawords.com/"+querynokeyword;
var xmlhttp=new ActiveXObject("MSXML2.XMLHTTP");
xmlhttp.onreadystatechange = function(){
if (xmlhttp.readyState == 4) {
var string = xmlhttp.responseText;
string = string.replace(/\n|\t/g,'');
string = string.match(/<dl class="word" id="word-.*?">.*?<\/dl>/g);
for(k=0;k<string.length;k++){
heading = string[k].match(/<dt class="title-word">.*?<a href=.*?>(.*?)<\/a>.*?<\/dt>/);
if(heading && heading[1])
output += "\\b "+heading[1]+"\\b0\\par\\par\n";
var body = string[k].match(/<dd class="entry.*?">.*?<\/dd>/g);
if(body)
for(i = 0;i<body.length;i++){
body = body.replace(/<a title="synonyms">more»<\/a>/g,"");
output += body.replace(/<.*?>/g,"")+"\\par\\par\n";
}
else output = "Nothing found";
}
FARR.setStrValue("statusbar","Define");
FARR.setStrValue("window.richeditmode",pre_string+output+post_string);
}
}
xmlhttp.open("GET",url,true);
xmlhttp.send(null);
}
I must say, that I am NOT coder either. FARR JS plugins are nearly my first touch of JS
So I am not the right person to revise your code
But it works perfectly
As to hyperlinks: I have tried to use hyperlinks in RTF but it does not display them as hyperlinks. So I guess we have to wait till there will be HTML support in FARR
EDIT: just one remark. Are you goining to publish this ninjawords plugin (so that others can use it too), or shall I do it?