topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Friday April 26, 2024, 7:18 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Nod5 [ switch to compact view ]

Pages: prev1 ... 36 37 38 39 40 [41] 42 43 44 45 46 47next
1001
Post New Requests Here / Re: IDEA: Stand alone bookmarks toolbar
« on: March 26, 2008, 05:26 PM »
This is a good idea app103!

It got me thinking... I'm looking for some way to have very quick access to a list of advanced searches on a whole set of bookmarks. Launchers like FARR can be used for that (that's what I'm using right now) but a specialized bookmark toolbar could be even faster for some purposes. So in addition to the regular folders on the toolbar (each folder acting as a dropdown menu for all bookmarks within it), there could also be some dropdown menus that list the results from advanced searches on a large set of bookmarks (Example: one dropdown meny lists the 20 most recent bookmarks with tag ____ in the name and with domain ___ in the URL).

1002
Find And Run Robot / Re: Alias sharing
« on: March 24, 2008, 06:51 PM »
Here's an alias for jumping straight to some point in the registry in RegEdit. It requires the freeware Regjump from SysInternals/Microsoft ( http://www.microsoft...laneous/Regjump.mspx ).

1. Download Regjump and put regjump.exe in the Helpers folder in the FARR directory (example: C:\program files\FindAndRunRobot\Helpers\regjump.exe ).
2. import this alias into FARR:
1000>>>regjump>->Regjump - $$1 | Helpers/regjump.exe $$1>+>^regj(?:|u|um|ump) (.*)
3. type regjump _________
where ____ is some registry path. Example: regjump HKEY_CURRENT_USER\Software\Microsoft

(I haven't learned how to make .alias files yet so the import code above will have to do, sorry)
(Mouser, is the Helper folder intended for extra programs like this? Or is some other location better?)

1003
The Firefox 3 betas are just amazing so I'm getting even closer to ditching Maxthon for Firefox (old habits die hard...). In that process I've found some new add-ons. One such great find is Drag & DropZone Searching  http://www.captainca...pzone-searching.aspx
004[1].JPG
opt.png

It is somewhat similar to  Drag de Go https://addons.mozil...S/firefox/addon/2918 (which does not work with FF3b5 yet). Both react to you dragging some text from a page and then dropping it. Drag de Go uses directional dropping; its reaction is based on what direction you drop the text in relative to the drag starting point. Drag & DropZone instead uses a grid of dropzones shown when dragging. An advantage with Drag & DropZone is that you won't have to memorize the various drag actions since you see them on screen.

Both add-ons are great for quick searching. I wish Drag & DropZone would expand the concept further though. I'd like to be able to use it's drop actions for more than searching, like copying to clipboard, saving to some file and in general passing the dropped text (and perhaps also page URL, title and so on) to external scripts.

1004
good find nosh! Several firefox add-ons have built in settings import/export functionality but a total backup would often be better.

1005
General Software Discussion / Re: Send link and/or webpage?
« on: March 23, 2008, 07:18 AM »
siouxdax, maybe you could use a url shorter site ( http://notlong.com/links/
 ) or an online clipboard site ( http://cl1p.net/ ) together with a script?

It would do this process: you press a hotkey and a script on the URL sending computer grabs the URL from FF, uploads it onto the url shorter/clipboard site. On the URL receiving computer, you press another hotkey and the script downloads and then launches the URL.

While I have no finished script to give you I have the feeling that it wouldn't be so complex to construct. Note that since you could set the script to recycle the same clipboard page/url shortcut you wouldn't have to worry about deleting old URLs (which was your objection to mousers suggestion about bookmark syncing).

1006
Living Room / Re: Downloadable Game for the Weekend: Bloodmasters
« on: March 21, 2008, 09:10 AM »
Bloodmasters is now open source. Sadly, it also seems to be half dead. It was long since I last played it but when I checked it out now there are few servers and almost no player. Sad, since the game is excellent.

1007
Great idea for a FARR plugin! It would be great if when typing "eject " FARR lists all devices in the results list for the user to choose from. Some filters would also be useful. For example, I have a usb tv card that I never ever want to eject so it would make sense if I could exclude that.

1008
I share the resentment towards having to go through so many of these. Worst of all are forums that both have really hard captchas (often rotated similar letters like lL1i oO0) and that reset ALL entered information when there is some minor error when clicking submit.

But I still see them as necessary in many cases. Better (less bad) alternatives are hard to find.

Here's an excellent Wired piece on the captcha pioneer Von Ahn: http://www.wired.com...ancomp?currentPage=1  Now you have an individual to mentally direct all your captcha frustration towards :D . The articles covers not only recaptcha but also many other examples where everyday necessary human task could be tapped into as a productive resource. That's what I love about the recaptcha project - you know that the captcha itself has some purpose (apart from blocking spammers) and that makes it less irritating.

1009
The latest JabRef is looking good! I will install and try it out a bit.

Yeah, the aggregated cost of EndNote licenses for academic institutions all around the world must be staggering by now! :o Imagine what a great FOSS program those resources could have fueled instead.

Another project of interest is OpenOffice Bibliographic (OOoBib), http://bibliographic.openoffice.org/ . They request programmers:
When will this wonderful facility be available ?  Development work for Bibliographic enhancements to OpenOffice is expected to commence from late 2007, and probably available for users in OpenOffice version 2.x/3.x (mid-late 2008 ???) see feature timeline. Also see a blog on plans for Writer.

See our development plans on the Developers' Wiki and the list of project tasks below.

The project urgently needs some experienced C++ developers to get this important work to the programing stage.

1010
Thanks for the feedback mouser & czechboy & ecaradec!  :Thmbsup:
Here is a new version with these improvements:
- the user chooses the input and output currency (stored in options.xml ). If the input/output phrase works in google, it should work in this plugin.
- the plugin uses google only once after each FARR restart, thereafter it uses the cached exchange rate which means lightning fast results. (I'll look into writing the exchange rate to a file later, but I suspect the current in memory cache is enough for most usage)

code for fscript.js :
// plugin script :
displayname="Currency Converter Mini";
versionstring="1.02.01";
releasedatestring="11.3.2008";
author="nod5";
updateurl="";
homepageurl="";
shortdescription="Convert from one currency to another via google.";
longdescription="To run the plugin, type \"ex 50 \" but replace 50 with the amount you want converted.\nSet input/output currency in advanced plugin options. (examples: $ £ GBP SEK canadian money )\nTest your input/output first by googling \"1 __ in __\", where _ is your input/output.\nAfter a FARR restart the first conversion uses google. Later conversions use the cached exchange rate.\nThe alias \"ex\" stands for exchange rate. The plugin converts one way, between two fixed currencies.\nFor other conversion needs just use google.";
advconfigstring="Currency Converter Mini";
readmestring="Currency Converter Mini";
iconfilename="favicon.ico";

aliasstr="ex";
regexstr="^ex ((?:\d|\.|\,)*?) $";
scriptregex=/^ex ((?:\d|\.|\,)*?) $/;
regexfilterstr="";
keywordstr="";
scorestr="300";

// type
UNKNOWN=0; FILE=1; FOLDER=2; ALIAS=3; URL=4; PLUGIN=5; CLIP=5;
// Postprocessing
IMMEDIATE_DISPLAY=0; ADDSCORE=1; MATCH_AGAINST_SEARCH=2;
// search state
STOPPED=0; SEARCHING=1;

var pre_string = "{\\rtf1\\ansi\\ansicpg1250\\deff0\\deftab709{\\fonttbl{\\f0\\fnil\\fcharset0 Arial;}}{\\colortbl ;\\red255\\green0\\blue0;}{\\*\\generator Msftedit 5.41.15.1507;}\\viewkind4\\uc1\\pard\\lang2057\\f0\\fs18 ";
var post_string = "\\par\n}";
var history = "";
var exrate = "";

function doQuery(querykey,querynokeyword){

querynokeyword = querynokeyword.replace(/,/g,'.');

if(exrate == ""){
  var url = "http://www.google.com/search?hl=en&q=1"+myinputcurrency+"+in+"+myoutputcurrency;
  var xmlhttp=new ActiveXObject("MSXML2.XMLHTTP");

  xmlhttp.onreadystatechange = function(){
    if (xmlhttp.readyState == 4) {
      var string = xmlhttp.responseText;
      string = string.match(/<b>1 .* = (?:\d|\.|\,)*? /g);
      var splitstring = string[0].split("=");
      var exrate = splitstring[1].slice(1,-1);
      string = exrate * querynokeyword;
      string = Math.round(string);
      string = querynokeyword+" "+myinputcurrency+" = "+string+" "+myoutputcurrency;
      FARR.setStrValue("statusbar","Currency Converter Mini");
      FARR.setStrValue("window.richeditmode",pre_string+string+post_string);
      }
    }
  xmlhttp.open("GET",url,true);
  xmlhttp.send(null);
}
else {
var string = exrate * querynokeyword;
string = Math.round(string);
string = querynokeyword+" "+myinputcurrency+" = "+string+" "+myoutputcurrency;
FARR.setStrValue("statusbar","Currency Convert Mini");
FARR.setStrValue("window.richeditmode",pre_string+string+post_string);
}

}

myinputcurrency="";
myoutputcurrency="";
function onOptionsChanged() {
    var options=new ActiveXObject("MSXML2.DOMDocument");
    options.load(currentDirectory+"\\options.xml")
    myinputcurrency=options.selectSingleNode("options/myinputcurrency").getAttribute("value");
    myoutputcurrency=options.selectSingleNode("options/myoutputcurrency").getAttribute("value");
}

function onInit(c) {
    currentDirectory=c;

    var options=new ActiveXObject("MSXML2.DOMDocument");
    if(!options.load(currentDirectory+"\\options.xml") ||
        options.selectSingleNode("options/myinputcurrency").getAttribute("value")=='' ||
        options.selectSingleNode("options/myoutputcurrency").getAttribute("value")=='') {
        options.loadXML("<options>\n"+
                        "<myinputcurrency label='exchange from :' value=''/>\n"+
                        "<myoutputcurrency label='exchange to :' value=''/>\n"+
                        "</options>");

        options.save(currentDirectory+"\\options.xml");
        options=null;
        FARR.showOptions();
    } else {
        onOptionsChanged();
    }
}



function onSearchBegin(querykey, explicit, queryraw, querynokeyword) {
  if(!explicit) {
    if(aliasstr.indexOf(querynokeyword)!=-1) {
      FARR.setState(querykey,1);
      FARR.emitResult(querykey,aliasstr, aliasstr, iconfilename,ALIAS,IMMEDIATE_DISPLAY,300);
      FARR.setState(querykey,0);
    }
    return;
  }
  FARR.setStrValue("statusbar","Currency Converter Mini");
    display = pre_string+"Type amount and hit \\b space\\b0"+post_string;
  FARR.setStrValue("window.richeditmode",display);
}

function onRegexSearchMatch(querykey,querynokeyword) {
  var match_reg = querynokeyword.match(scriptregex);
  doQuery(querykey,match_reg[1]);
}

edit:
- Can I add a title or description to the settings popup? (the one that stores the input/output in options.xml)
- I tried using escaping $ to \$ but still couldn't get it to work as an alias. Are you sure that it is possible in FARR?

1011
edit 080813: thread renamed to "CurrencyConverterMini (plugin)" from "google dollar exchange rate plugin -- sketch" /nod5

While the donationcoder server was down I tried to put together a plugin based on the javascript SDK that takes a number as an input and queries google what that amount of dollars exchanges to in swedish kronor. In the finished plugin that swedish kronor part should of course be customizable to whatever currency the user prefers. Below is the fscript.js I've put together so far. It works, but is a bit messy and lacks some things. To try it, make a copy of the Ninjawords plugin folder (for example) and replace the fscript.js script code with the one below. type "ex ___ " to run it, where ___ is some amount . Example: "ex 50 " . The plugin currently treats "ex 50.10 " and "ex 50,10 " as identical (50 dollars and 10 cents).

This is only a sketch version of the script. I'd love some assistance on a few things:

help1: How do I most easily let the user choose the output currency and make the plugin remember that?

help2: I want the plugin to go through these three steps: First, if there is a cached daily exchange rate, use that to calculate and display output. Second, if not, query google, parse, display output and cache exchange rate. Third, if the google query failed (i.e. offline), see if there's a cached older exchange rate, use that to calculate and display output plus a note that N days old rate was used. Now, how do I best do I best cache the exchange rate through javascript in the plugin? I basically need to read and write to a text file I guess but I don't even know how to do that I'm afraid :o

help3: I used "ex" as alias only because I couldn't get "$" to work (I wanted "$50 " to run the script for example). Is there some way to use "$" as an alias?


// plugin script :
displayname="Google exchange rate";
versionstring="1.01.01";
releasedatestring="5.3.2008";
author="nod5";
updateurl="";
homepageurl="";
shortdescription="Google exchange rate";
longdescription="the plugin queries google how many swedish kronor you get for the inputted amount of US dollars";
advconfigstring="Google exchange rate";
readmestring="Google exchange rate";
iconfilename="favicon.ico";

aliasstr="ex";
regexstr="^ex ((?:\d|\.|\,)*?) $";
scriptregex=/^ex ((?:\d|\.|\,)*?) $/;
regexfilterstr="";
keywordstr="";
scorestr="300";

// type
UNKNOWN=0; FILE=1; FOLDER=2; ALIAS=3; URL=4; PLUGIN=5; CLIP=5;
// Postprocessing
IMMEDIATE_DISPLAY=0; ADDSCORE=1; MATCH_AGAINST_SEARCH=2;
// search state
STOPPED=0; SEARCHING=1;

var pre_string = "{\\rtf1\\ansi\\ansicpg1250\\deff0\\deftab709{\\fonttbl{\\f0\\fnil\\fcharset0 Arial;}}{\\colortbl ;\\red255\\green0\\blue0;}{\\*\\generator Msftedit 5.41.15.1507;}\\viewkind4\\uc1\\pard\\lang2057\\f0\\fs18 ";
var post_string = "\\par\n}";
var history = "";

function doQuery(querykey,querynokeyword){

      querynokeyword = querynokeyword.replace(/,/g,'.');

  var url = "http://www.google.co.../search?hl=en&q="+querynokeyword+"$+in+sek";
  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.replace(/<font size=-2> <\/font>/g,'');
      string = string.replace(/.+US(\$ = (?:\d|\.|\,)*?) Swedish kronor.*$/g,'US$1');
      xpos = string.search(/US(\$ = .*)/g);
      string = querynokeyword+" "+string.slice(xpos)+" SEK"
      FARR.setStrValue("statusbar","Define");
      history = string;
      FARR.setStrValue("window.richeditmode",pre_string+history+post_string);
      }
    }
  xmlhttp.open("GET",url,true);
  xmlhttp.send(null);
}

function onSearchBegin(querykey, explicit, queryraw, querynokeyword) {
  if(!explicit) {
    if(aliasstr.indexOf(querynokeyword)!=-1) {
      FARR.setState(querykey,1);
      FARR.emitResult(querykey,aliasstr, aliasstr, iconfilename,ALIAS,IMMEDIATE_DISPLAY,300);
      FARR.setState(querykey,0);
    }
    return;
  }
  FARR.setStrValue("statusbar","$ to SEK google converter");
    display = pre_string+"Type $ amount and hit \\b space\\b0"+post_string;
  FARR.setStrValue("window.richeditmode",display);
}

function onRegexSearchMatch(querykey,querynokeyword) {
  var match_reg = querynokeyword.match(scriptregex);
  doQuery(querykey,match_reg[1]);
}

1012
Donationcoder back online - great great great!  :Thmbsup:

1013
Sure:
~Space::
IfWinActive %A_Space%Find and Run Robot v2
 if A_PriorHotkey = %A_ThisHotkey%
  if A_TimeSincePriorHotkey < 400
   sendinput \
return
But I started this thread more in a missionary mode of mind, thinking that a double space command might be handy enough for many users of FARR to be built in.

1014
/ is shift 7 on my layout, which is even more tricky since it takes two hands. \ (AltGr +) can be pulled off with one hand at least.
http://en.wikipedia....ut#Swedish.2FFinnish

Neither \ or / is of course extremely slow to hit or anything. But the advantage of double space is not so much speed as not having to look at the keys. Many people find the space key immediately (regardless of what keyboard layout they use I would imagine) but many need to look for \ or / .

1015
Today we can narrow a search in FARR to folders only by adding "\" (backslash). Example: compare a search for "program" and "program\"

But on some keyboard layouts the backslash is tricky to reach. For instance, on my swedish keyboard I must press AltGr + (plus key) to get a backslash. Since the space bar is easy to reach on all keyboard layouts I've seen, why not let a double space do the same thing as the backslash currently does? Of course if the user has a lot of files with double spaces in their names then this idea would mean trouble. But I suspect file naming is extremely uncommon.

edit: alternatively, multiple spaces could be tied to some other function. For example, FARR could see any sequence of spaces that is even (2,4,6...) as identical as the +sall command, but see uneven number of spaces as a deactivation of that command. That way, the user could very quickly toggle the +sall functionality on and off. Other uses are possible also I guess but the double space sequence seems so quick and easy to remember that it should be used for something! :)

1016
Find And Run Robot / Re: Ninjawords
« on: February 25, 2008, 05:15 AM »
czechboy: confirming that it works. But I think your latest version (1.01.05) missed to include one previous line needed for displaying the history (@ line 58):
history = string + ((history == "")?"":"\\par -----------------------------\\par ") + history;

1017
Find And Run Robot / Re: Ninjawords
« on: February 24, 2008, 05:42 AM »
Well the Definr plugin also works fine. It gives somewhat longer definitions. So it depends on what you prefer I think. Why not testdrive both for a while? I'll myself do just that. If I later still prefer Ninjawords then I'll tie the handy "df" alias (much easier to remember than "nw") to it on my local mod of the script.

1018
Find And Run Robot / Re: Ninjawords
« on: February 23, 2008, 12:35 PM »
The temporary history works fine. :up: I can see some neat uses for a feature like that. Someone might want to do a lot of separate lookups and then export all of the definitions in one go. They now only need to select all and copy and paste.

Did you try the alternative code for grabbing the definition that I posted https://www.donation....msg103138#msg103138 ? It works fine here and I see no drawbacks. Possible advantages:
1. It seems slightly faster, but that might just be wishful thinking. :-)
2. it adds a dot and a space before any examples in the definition, which the old code didn't do.
regular code:
  red
(adj): having red as its colour; of hair, having an orange-brown colour"the girl wore a red skirt."
alternative code:
  red
(adj): having red as its colour; of hair, having an orange-brown colour. "the girl wore a red skirt."
3. When doing multiple lookups ("nw one,two ") the alternative grabbing code places the definition for "one" at the top of the FARR results window and the definition for "two" below it. That seems more intuitive to me. The regular code (and the regular ninjawords.com searchbox) gives the definitions in the reverse order ("two" at top, "one" below it). I guess an advantage with the regular code is that it gives a consistent search history ordering: the latest entered searchphrase always gets it definition displayed at the top. I still prefer the alternative code's ordering though.

Oh and at the top of this thread it says "Authors: Nod5". I'm proud to be mentioned but clearly you should also be there czechboy!

1019
FARR Plugins and Aliases / Re: Definr.com plugin
« on: February 22, 2008, 08:29 AM »
I gave the alternative page for grabbing the definitions ( http://ninjawords.co...initions/getdef/test ) a go after all. Do you notice any difference in speed? Also, since the definitions are grabbed blazingly fast, maybe it's best to remove the "Please wait..." text completely? It just causes FARR to flicker a very brief moment but is almost not readable.

edit: this cuts off some words it seems, will troubleshoot that later. edit2: works now, I earlier forgot to escape \ at one place
function doQuery(querykey,querynokeyword){
  var url = "http://ninjawords.com/definitions/getdef/"+querynokeyword;
  var xmlhttp=new ActiveXObject("MSXML2.XMLHTTP");
  xmlhttp.onreadystatechange = function(){
    if (xmlhttp.readyState == 4) {
      var string = xmlhttp.responseText;
      string = string.replace(/\\n|\\t/g,'');
      var splitString = string.split('\\074dt class=\\"title-word\\"\\076');
      var string ="";
      for (var i=1;i<splitString.length; ++i){
        if (i > 1) {
          string +="\\par -----------------------------\\par ";
        }
        splitString[i] = "\\b " + splitString[i];
        splitString[i] = splitString[i].replace(/", query: ".*?$/,"");
        splitString[i] = splitString[i].replace(/\\074dd.*?\\076/g,'\\b0 \\par\\par ');
        splitString[i] = splitString[i].replace(/ :\\074\/span\\076/g,": ");
        splitString[i] = splitString[i].replace(/\\074div class=\\"examples\\"\\076/g,"\. ");
        splitString[i] = splitString[i].replace(/\\074.*?\\076/g,"");
        splitString[i] = splitString[i].replace(/\\u2014/g,"-");
        splitString[i] = splitString[i].replace(/\\u2019/g,"'");
        splitString[i] = splitString[i].replace(/&mdash/g,"-");
        splitString[i] = splitString[i].replace(/more&raquo;\,/g,"");
        string += splitString[i];
      }
      FARR.setStrValue("statusbar","Define");
      FARR.setStrValue("window.richeditmode",pre_string+string+post_string);
      }
    }
  xmlhttp.open("GET",url,true);
  xmlhttp.send(null);
}

1020
FARR Plugins and Aliases / Re: Definr.com plugin
« on: February 22, 2008, 07:43 AM »
Great. I'll try it now.  edit: works fine"  :Thmbsup:

Two more things:
- the ninjawords plugin page says "nw - to start Definr plug-in" when you really mean "nw - to start Ninjawords plug-in".
- note that: "nw school, wall " is not needed for multiple lookups. "nw school,wall " is enough. That way the plugin accesses the Ninjawords site only once compared to twice.

Using http://ninjawords.co...initions/getdef/test from the beginning would probably have been best, but I'm not sure if its needed now.
How many milliseconds do you think we'll save by using it? ;D

1021
FARR Plugins and Aliases / Re: Definr.com plugin
« on: February 22, 2008, 07:14 AM »
I just tried your version of the Ninjawords script. It did not run here. After entering the search string I get "please wait..." and then nothing happens. Not sure why. Does it work for you? I updated my version some more based on your code (simplified the replace steps, made each search phrase bold). Feel free to use it.
function doQuery(querykey,querynokeyword){
    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,'');
var splitString = string.split('<dt class="title-word">');
       
        var string ="";

for (var i=1;i<splitString.length; ++i){

    if (i > 1) {
               string +="\\par -----------------------------\\par ";
               }
splitString[i] = "\\b " + splitString[i]
        splitString[i] = splitString[i].replace(/<\/dl>.*?$/,"");
splitString[i] = splitString[i].replace(/<dd.*?>/g,'\\b0 \\par\\par ');
        splitString[i] = splitString[i].replace(/ :<\/span>/g,": ");
splitString[i] = splitString[i].replace(/more&raquo;/g,'');
splitString[i] = splitString[i].replace(/&mdash;/g,'-');
        splitString[i] = splitString[i].replace(/<.*?>/g,"");
string += splitString[i];
}
         
        FARR.setStrValue("statusbar","Define");
        FARR.setStrValue("window.richeditmode",pre_string+string+post_string);
      }
    }
    xmlhttp.open("GET",url,true);
    xmlhttp.send(null);
}

I forgot to mention one more advantage with Ninjawords: if you spell a word wrong it automatically guesses the word and shows the definition - try "nw footbaall ". Definr on the other hand shows a list of terms and forces the users to choose one.

As for that XML thing I think I understand what you mean. Promising. I can already think of several websites that I'd want FARR to grab specific content from and display to me in an instant. But I'm not sure if people will prefer that over site specific plugins. And I don't know how to write XML so I can't help much I'm afraid.

edit: I now saw that you created a new thread ( https://www.donation...ex.php?topic=12421.0 ). The ninjawords version on your page does return definitions. But I think there is some error in the parsing code. Try "nw test,gone " and "nw gone,test ". In the first case, the bold "gone" is missing. In the second case, both "gone" and it's definition is missing. I'm not sure what the cause of that is.

1022
FARR Plugins and Aliases / Re: Definr.com plugin
« on: February 22, 2008, 04:08 AM »
czechboy,
It's better that you do it since I based my version on your code and you have a page set up already.

I'm myself more and more convinced that ninjawords is better than definr. It is noticeably faster from my location. It also gives definitions that are shorter and more to the point (which is almost always enough). It also allows multiple lookups in one search. The only drawback I can find with ninjawords is that it gives errors when the search phrase contains dots (try searching for "i.e."). I'll email the ninjawords dev about that.

Perhaps in the future your plugin could be expanded with some option where the user can choose what definition site to use (Definr, ninjawords, possibly others...)? Since some might still prefer definr.

I also must make a general exclamation: these javascript plugins (and the underlying javascript SDK) has really opened up my eyes to how great FARR can be at interacting with the web (doing queries, grabbing content...).  :Thmbsup:

1023
FARR Plugins and Aliases / Re: Definr.com plugin
« on: February 21, 2008, 04:20 PM »
czechboy,
I've now testdriven the plugin some more. The searches are not always incredibly fast, despite what definr.com claim. Pretty often they take several seconds.

I found a similarly clean site, http://ninjawords.com/ , that seems faster (at least from my location). We're only talking slightly faster, but still. So I tried to learn from your fscript.js to grab definitions from ninjawords.com instead. The resulting code follows below. Do you spot any errors? It at least seems to run ok but I don't really know javascript or the FARR javascript SDK so there might be errors. The many replace functions look very messy but I'm not sure how to simplify them.

Also, a general question (maybe mouser or someone else can answer this too): is it possible to make some phrases in the grabbed text into hyperlinks when displayed in FARR?

edit: I tweaked it some more so that it now supports multiple lookups at once. Just type "nw word1,word2 " (see http://ninjawords.com/info/about/ for more on that)

// plugin script :
displayname="ninjawords.com";
versionstring="1.0.0";
releasedatestring="21.2.2008";
author="nod5 (based on Definr plugin by Oldrich Svec)";
updateurl="";
homepageurl="";
shortdescription="ninjawords.com";
longdescription="defines words through http://ninjawords.com";
advconfigstring="ninjawords.com";
readmestring="ninjawords.com";
iconfilename="";

aliasstr="nw";
regexstr="^nw (.*?) $";
scriptregex=/^nw (.*?) $/;
regexfilterstr="";
keywordstr="";
scorestr="300";

// type
UNKNOWN=0; FILE=1; FOLDER=2; ALIAS=3; URL=4; PLUGIN=5; CLIP=5;
// Postprocessing
IMMEDIATE_DISPLAY=0; ADDSCORE=1; MATCH_AGAINST_SEARCH=2;
// search state
STOPPED=0; SEARCHING=1;

var pre_string = "{\\rtf1\\ansi\\ansicpg1250\\deff0\\deftab709{\\fonttbl{\\f0\\fnil\\fcharset0 Arial;}}{\\colortbl ;\\red255\\green0\\blue0;}{\\*\\generator Msftedit 5.41.15.1507;}\\viewkind4\\uc1\\pard\\lang2057\\f0\\fs18 ";
var post_string = "\\par\n}";

function doQuery(querykey,querynokeyword){
    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/g,'\\par');
var splitString = string.split('<dt class="title-word">');
       
        var string ="";

for ( var i=1, len=splitString.length; i<len; ++i ){

    if (i > 1) {
               string +="\\par -----------------------------\\par ";
               }
        splitString[i] = splitString[i].replace(/<\/dl>.*?$/,"");
splitString[i] = splitString[i].replace(/<dd.*?>/g,'\\doublepar ');
        splitString[i] = splitString[i].replace(/ :<\/span>/g,": ");
splitString[i] = splitString[i].replace(/more&raquo;/g,'');
splitString[i] = splitString[i].replace(/&mdash;/g,'-');
        splitString[i] = splitString[i].replace(/<.*?>/g,"");
splitString[i] = splitString[i].replace(/\t/g,'');
splitString[i] = splitString[i].replace(/\\par\s*?(\S)/g,'\\par$1');
splitString[i] = splitString[i].replace(/\\par/g,'');
splitString[i] = splitString[i].replace(/\\doublepar/g,'\\par\\par');
string += splitString[i];
}
         
        FARR.setStrValue("statusbar","Define");
        FARR.setStrValue("window.richeditmode",pre_string+string+post_string);
      }
    }
    xmlhttp.open("GET",url,true);
    xmlhttp.send(null);
}

function onSearchBegin(querykey, explicit, queryraw, querynokeyword) {
  if(!explicit) {
    if(aliasstr.indexOf(querynokeyword)!=-1) {
      FARR.setState(querykey,1);
      FARR.emitResult(querykey,aliasstr, aliasstr, iconfilename,ALIAS,IMMEDIATE_DISPLAY,300);
      FARR.setState(querykey,0);
    }
    return;
  }
  FARR.setStrValue("statusbar","Define");
  FARR.setStrValue("window.richeditmode",pre_string+"Type what you want to search and hit Space"+post_string);
}

function onRegexSearchMatch(querykey,querynokeyword) {
  FARR.setStrValue("statusbar","Define");
  FARR.setStrValue("window.richeditmode",pre_string+"Please wait..."+post_string);
  var match_reg = querynokeyword.match(scriptregex);
  doQuery(querykey,match_reg[1]);
}


1024
Is this possible in the current version of FARR: The user does a regular search which yields N number of matches. Because a special command was added to the search FARR sorts the matches strictly based on the date the files where created (the newest are displayed first). This date sorting should override any other ranking rules.

Just to make things clear, I only want this for some special searches, not for most searches, so I'm looking for some extra command to use in such special cases.

1025
FARR Plugins and Aliases / Re: Definr.com plugin
« on: February 20, 2008, 01:56 PM »
Nice work czechboy! Very useful plugin!  :Thmbsup:

A small suggestion: it takes me more time to find the "," key compared to the space key. I managed to tweak your fscript.js so that "df football " triggers the search instead of "df football,". The plugin can still look up definitions for space separated phrases: "df foul ball ". It starts to search for "foul" but interrupts that when new non-space characters are entered and then searches the whole phrase "foul ball" when the next space is entered. I hope you'll consider using space for triggering the search in your official version.

I just changed:
regexstr="^df (.*?),$";
scriptregex=/^df (.*?),$/;
To:
regexstr="^df (.*?) $";
scriptregex=/^df (.*?) $/;

edit: I also decreased the font size (from f26 to f18) to lessen the number of linebreaks in the definition texts


Pages: prev1 ... 36 37 38 39 40 [41] 42 43 44 45 46 47next