topbanner_forum
  *

avatar image

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

Login with username, password and session length
  • Friday March 29, 2024, 7:26 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

Last post Author Topic: FARR plugin: FarrWebMetaSearch 1.6.0  (Read 81918 times)

Perry Mowbray

  • N.A.N.Y. Organizer
  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 1,817
    • View Profile
    • Donate to Member
Re: FARR plugin: FarrWebMetaSearch 1.4.2
« Reply #25 on: February 05, 2010, 05:59 AM »
Forgot to mention: I'm open to suggestions with these  :D

ewemoa

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 2,922
    • View Profile
    • Donate to Member
Re: FARR plugin: FarrWebMetaSearch 1.4.2
« Reply #26 on: February 05, 2010, 06:51 AM »
I tried my hand at creating a .conf [1] for a page that's got static results:

  http://www.autohotke...title=Script_Listing

This didn't seem to work -- using Wireshark, noticed that FarrWebMetaSearch seems to append the query string to the end of searchUrl.  This makes a lot of sense for non-static searches of course :)  Is there a way to not have it do that?  (Sorry if I missed the discussion of how to do this if it has already been mentioned -- I did scan this topic and the help file, FWIW  8) )

Below is the .conf so far:

description=AutoHotkey Script Listing
searchUrl=http://www.autohotkey.com/wiki/index.php?title=Script_Listing
resultPattern=<p><a href="([^"]+)" class="external text" title="[^"]+" rel="nofollow">([^>]+)</a> by <a href="[^"]+" class="external text" title="[^"]+" rel="nofollow">([^>]+)</a>
farrCaption=$2
farrGroup=$3
farrPath=$1


[1] I'm slightly confused -- I noticed the docs say .config, but only see .conf files.  Would someone mind straightening me out?

Perry Mowbray

  • N.A.N.Y. Organizer
  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 1,817
    • View Profile
    • Donate to Member
Re: FARR plugin: FarrWebMetaSearch 1.4.2
« Reply #27 on: February 05, 2010, 06:57 AM »
add isFeed=true and it won't append the searchterm

.conf is the only extension

 :Thmbsup:

Perry Mowbray

  • N.A.N.Y. Organizer
  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 1,817
    • View Profile
    • Donate to Member
Re: FARR plugin: FarrWebMetaSearch 1.4.2
« Reply #28 on: February 05, 2010, 07:12 AM »
I've just done a very quick search config for DevCheatSheets is on this thread.

ewemoa

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 2,922
    • View Profile
    • Donate to Member
Re: FARR plugin: FarrWebMetaSearch 1.4.2
« Reply #29 on: February 05, 2010, 07:22 AM »
Thanks a lot, Perry  :Thmbsup:

Below is the modified and tested (err, slightly) .conf file.
description=AutoHotkey Script Listing
searchUrl=http://www.autohotkey.com/wiki/index.php?title=Script_Listing
resultPattern=<p><a href="([^"]+)" class="external text" title="[^"]+" rel="nofollow">([^>]+)</a> by <a href="[^"]+" class="external text" title="[^"]+" rel="nofollow">([^>]+)</a>
farrCaption=$2
farrGroup=$3
farrPath=$1
isFeed=true


It may be obvious, but just in case: one can get an icon for AHK via http://www.autohotkey.com/favicon.ico

phitsc

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 1,198
    • View Profile
    • Donate to Member
Re: FARR plugin: FarrWebMetaSearch 1.4.2
« Reply #30 on: February 05, 2010, 07:37 AM »
    Requested New Functionality to WMS  :)
    • subSearch sorting: I've added a parameter to the subSearches though it can be named anything. OneLook suffers from not having the ability to sort the subSearches.
    • subSearch hiding: Some of the subSearches in TimeAndDate should only be used from the context menu as typing the search criteria in doesn't make sense (and crashes FARR at the moment)
    • Context Menu:
      • I seem to have hit the limit with the context menu. Is that a WMS restriction or FARR?
      • The context menus don't seem to be being cleared for each subSearch. You can see this in the OneLook search: the submenus for the default search are carried over to all of the subSearches. I think it would be preferable to start each subSearch fresh.
      • Can we have subMenus? I'd like to put all the dictionary type searches into a subMenu (Art, Computer, etc)
    • Two-stage RegEx: Those dictionary type searches could really do with a two-stage RegEx Match where the second RegEx operates on the result of the first. I also wondered if a RegEx Replace was possible (would help cleaning up some pages).
    • Search Navigation: It would be helpful to have an ability to backwards and forwards in the search results. Sometimes you can not get back to where you came from with the search results, and a back button would be helpful. Something like this:
      • wms timeanddate +w: cities displayed
      • type "syd": filter to "Sydney"
      • select forecast context menu: 14 day forecast displayed
      • at this point I would like to go back one step to the cities filtered on "syd" to access the current conditions context menu.
    • subSearch sorting: done
    • subSearch hiding: done
    • context menu item count limitation: fixed
    • context menu items not cleared for subsearches: fixed (but see below)
    • context sub menus: done

    Multi-stage regex and history will have to wait a bit longer I'm afraid :(. Concerning multi-stage regex: how should we specify input/output from one stage to the next?

    Until now, subsearches would inherit any parameters from the main search if they were not specified. This leads to the problem you describe. I've thought about a way to keep this behaviour but get rid of the problem, but did not find anything that pleased me. I saw that you were not using that 'feature' anyway (except maybe for the isFeed parameter) so I just got rid of it thus solving that problem.[/list]
    « Last Edit: February 05, 2010, 07:41 AM by phitsc »

    Perry Mowbray

    • N.A.N.Y. Organizer
    • Charter Member
    • Joined in 2005
    • ***
    • Posts: 1,817
      • View Profile
      • Donate to Member
    Re: FARR plugin: FarrWebMetaSearch 1.4.2
    « Reply #31 on: February 05, 2010, 07:40 AM »
    That's way cool  :Thmbsup:

    If you do something like the following (that is adding author to the caption) you can also search by author  :)

    You can also add simple html to the output if you like, and add context menus...

    Code: Javascript [Select]
    1. description=AutoHotkey Script Listing
    2. searchUrl=http://www.autohotkey.com/wiki/index.php?title=Script_Listing
    3. resultPattern=<p><a href="([^"]+)" class="external text" title="[^"]+" rel="nofollow">([^>]+)</a> by <a href="([^"]+)" class="external text" title="[^"]+" rel="nofollow">([^>]+)</a>
    4. farrCaption=$2 :: $4
    5. farrGroup=<i>Written by $4</i>
    6. farrPath=$1
    7. isFeed=true
    8. contextCaption1=Open $4's Profile
    9. contextIcon1=autohotkeyscripts.ico
    10. contextHint1=Open $4's Profile
    11. contextPath1=$3

    phitsc

    • Honorary Member
    • Joined in 2008
    • **
    • Posts: 1,198
      • View Profile
      • Donate to Member
    Re: FARR plugin: FarrWebMetaSearch 1.4.2
    « Reply #32 on: February 05, 2010, 07:49 AM »
    I've just done a very quick search config for DevCheatSheets is on this thread.
    Cheers! And I have done one that uses the site's search engine:

    Code: Javascript [Select]
    1. description=Cheat sheets for developers
    2. searchUrl=http://devcheatsheet.com/search/?q=
    3. resultPattern=<h2><a href="([^"]*)" title="[^"]*">(.*)</h2>\s*Source: <a href="([^"]*)" title="[^"]*">(.*)</a><br>\s*(.*)<br>\s*Tag(?:s)?: <a href="([^"]*)" title="[^"]*">(.*)</a><br>
    4. farrCaption=$2
    5. farrGroup=Source: $4, $5
    6. farrPath=$1

    I'll merge this as a subsearch into yours if you don't mind.

    Perry Mowbray

    • N.A.N.Y. Organizer
    • Charter Member
    • Joined in 2005
    • ***
    • Posts: 1,817
      • View Profile
      • Donate to Member
    Re: FARR plugin: FarrWebMetaSearch 1.4.2
    « Reply #33 on: February 05, 2010, 07:58 AM »
    I'll merge this as a subsearch into yours if you don't mind.

    I actually had the same thought about yours  ;) I was going to say why don't you add mine as a subSearch on yours: +tag, +tag2, +tag3, etc

    ...that way when you type cheatsheets and it'll wait for your input and then you can +tag to get the tag list??

    ewemoa

    • Honorary Member
    • Joined in 2008
    • **
    • Posts: 2,922
      • View Profile
      • Donate to Member
    Re: FARR plugin: FarrWebMetaSearch 1.4.2
    « Reply #34 on: February 05, 2010, 07:59 AM »
    If you do something like the following (that is adding author to the caption) you can also search by author  :)

    Nice!


    You can also add simple html to the output if you like, and add context menus...
    -Perry Mowbray

    Thank you for your generous teachings, master  ;D

    Perry Mowbray

    • N.A.N.Y. Organizer
    • Charter Member
    • Joined in 2005
    • ***
    • Posts: 1,817
      • View Profile
      • Donate to Member
    Re: FARR plugin: FarrWebMetaSearch 1.4.2
    « Reply #35 on: February 05, 2010, 08:43 AM »
    Multi-stage regex and history will have to wait a bit longer I'm afraid :(. Concerning multi-stage regex: how should we specify input/output from one stage to the next?

    What can I say? I can't wait to play!!!

    With the RegEx: do you think we can do it very simply and extensible:
    resultPattern=...
    resultPattern2=...
    resultPattern3=

    and each 2+ takes the Matched String from the previous as it's input? I can only see a use for getting a block of content initially, so I can't see any benefit in passing all the grouped matches? Can you??

    Maybe a new keyword %MATCH%?

    Is a RegEx replace possible? could you specify replacePattern= so effectively it would Regex.Replace(%MATCH%,"resultPattern","replacePattern")

    ewemoa

    • Honorary Member
    • Joined in 2008
    • **
    • Posts: 2,922
      • View Profile
      • Donate to Member
    Re: FARR plugin: FarrWebMetaSearch 1.4.2
    « Reply #36 on: February 09, 2010, 05:29 AM »
    I'd like to be able to specify local files for searchUrl (e.g. for a local copy of the autohotkey script listing page).

    Is it possible to do this already and if so, is there a way to do it without specifying absolute paths?

    phitsc

    • Honorary Member
    • Joined in 2008
    • **
    • Posts: 1,198
      • View Profile
      • Donate to Member
    Re: FARR plugin: FarrWebMetaSearch 1.4.2
    « Reply #37 on: February 09, 2010, 05:37 AM »
    I'd like to be able to specify local files for searchUrl (e.g. for a local copy of the autohotkey script listing page).

    Is it possible to do this already and if so, is there a way to do it without specifying absolute paths?

    You mean instead of searching in a file downloaded from the web, you want to search in a local file?

    ewemoa

    • Honorary Member
    • Joined in 2008
    • **
    • Posts: 2,922
      • View Profile
      • Donate to Member
    Re: FARR plugin: FarrWebMetaSearch 1.4.2
    « Reply #38 on: February 09, 2010, 07:34 AM »
    You mean instead of searching in a file downloaded from the web, you want to search in a local file?

    Exactly.

    phitsc

    • Honorary Member
    • Joined in 2008
    • **
    • Posts: 1,198
      • View Profile
      • Donate to Member
    Re: FARR plugin: FarrWebMetaSearch 1.4.2
    « Reply #39 on: February 09, 2010, 08:57 AM »
    Is it possible to do this already and if so, is there a way to do it without specifying absolute paths?
    It's not currently possible. If not absolute, relative to what would you like to specify it?

    Perry Mowbray

    • N.A.N.Y. Organizer
    • Charter Member
    • Joined in 2005
    • ***
    • Posts: 1,817
      • View Profile
      • Donate to Member
    Re: FARR plugin: FarrWebMetaSearch 1.4.2
    « Reply #40 on: February 09, 2010, 04:09 PM »
    I'd like to be able to specify local files for searchUrl (e.g. for a local copy of the autohotkey script listing page).

    Is it possible to do this already and if so, is there a way to do it without specifying absolute paths?

    You mean instead of searching in a file downloaded from the web, you want to search in a local file?

    What a nice idea!  :Thmbsup:

    What about the output of a executable? That would be interesting...

    ewemoa

    • Honorary Member
    • Joined in 2008
    • **
    • Posts: 2,922
      • View Profile
      • Donate to Member
    Re: FARR plugin: FarrWebMetaSearch 1.4.2
    « Reply #41 on: February 10, 2010, 06:02 AM »
    It's not currently possible. If not absolute, relative to what would you like to specify it?

    Ok, thanks for the answer.

    By "without specifying absolute paths" I was hoping for something along the lines of what's described below.  Sorry for the vagueness.

    • One idea is to be able to specify a path using FARR's "virtual folder" functionality as mentioned in the "Variable Replacements, Virtual Folder Names, Env Paths" section of the help file.  For example, being able to use %APPDRIVE%, %PLUGINDIR%, and the like as part of the path specification.  For reference, I believe "resolve" described in the "Values Getable by Plugins" section of the FARR help file can help with this.
    • Another is to be able to apply user variables.  For example, I have something like the following defined in the [Paths] section of my user variables:

        par=%APPDRIVE%\apps

      So using:

        %uservar.Paths.par%

      as part of a path.
    • The last idea is for non-absolute paths to be resolved relative the FarrWebMetaSearch plugin (or perhaps searches) directory.

    Any of these would help with my portable set up :)

    ewemoa

    • Honorary Member
    • Joined in 2008
    • **
    • Posts: 2,922
      • View Profile
      • Donate to Member
    Re: FARR plugin: FarrWebMetaSearch 1.4.2
    « Reply #42 on: February 10, 2010, 06:19 AM »
    What about the output of a executable? That would be interesting...

    That does sound interesting.  Haven't thought of a good use for it yet though :)

    Alien282

    • Participant
    • Joined in 2010
    • *
    • default avatar
    • Posts: 6
      • View Profile
      • Donate to Member
    Re: FARR plugin: FarrWebMetaSearch 1.4.2
    « Reply #43 on: April 24, 2010, 06:27 PM »
    Hello,

    Thanks for a really nice plugin! I needed Google search (strange that nobody has asked for that yet?), especially with calculator and converter support - that is, I wanted to be able to input "50 eur in usd" and get the answer from Google. "50 km in miles" works too. Here is the conf file:

    Code: Javascript [Select]
    1. description=Google
    2. searchUrl=http://www.google.com/search?q=
    3. resultPattern=(?:<td>\s*<img src="?/images/calc_img\.gif"? width="?40"? height="?30"? alt="">.*?<h2 class="?r"? style="font-size:138%">\s*<b>(.*?)</b>\s*</h2>|<h3 class="?r"?>\s*<a href="(.+?)" class="?l"?.*?>(.*?)</a>\s*</h3>.*?<div class=(?:s|"s hc".*?|"s")>(.*?)<br>)
    4. farrCaption=$1$3
    5. farrGroup=$1$4
    6. farrPath=$1$2

    I haven't tested it too extensively, but it is supposed to work. :) I've attached a picture to see how it works.

    BTW, since I am a bit new to FARR, I am not sure how (or even if) I could make an alias or something that allowes me to type "gs " and after that it should work as if I had written "wms google " and make a live search to google with whatever I am typing?

    P.S. aaah yes, and is it possible to have text in itallics or bold, or different color in the results window? Strangely enough, FARR seems to "cope" with the markup coming from Google - it ignores it. :)
    « Last Edit: April 24, 2010, 06:50 PM by Alien282 »

    satch

    • Participant
    • Joined in 2008
    • *
    • Posts: 5
      • View Profile
      • Donate to Member
    Re: FARR plugin: FarrWebMetaSearch 1.4.2
    « Reply #44 on: April 24, 2010, 06:56 PM »
    I was just wondering if it could be easy to develop a config file for wordpress based sites. At work we use p2 theme for colaboration and it could be so cool to be able to search without opening browser. I've taken a look to sourcecode, but I can't find a way to search both posts and comments in a single search, as information could be in a reply. Using p2 it doesn't seem like a blog anymore, it seems more like twitter, so searching both makes a lot of sense. You can check a sample site here http://p2demo.wordpress.com

    I'm getting to addicted to FARR. I was mad looking for Launchy plugins, then found FARR and there is no step back. You, FARR community make it so awesome.

    Perry Mowbray

    • N.A.N.Y. Organizer
    • Charter Member
    • Joined in 2005
    • ***
    • Posts: 1,817
      • View Profile
      • Donate to Member
    Re: FARR plugin: FarrWebMetaSearch 1.4.2
    « Reply #45 on: April 25, 2010, 03:09 AM »
    P.S. aaah yes, and is it possible to have text in itallics or bold, or different color in the results window? Strangely enough, FARR seems to "cope" with the markup coming from Google - it ignores it. :)

    Yes: you just set it in your definition -- simple html format works fine. something like
    Code: HTML [Select]
    1. <i>$2</i>
    works OK: I've used that in my onelook search.

    phitsc

    • Honorary Member
    • Joined in 2008
    • **
    • Posts: 1,198
      • View Profile
      • Donate to Member
    Re: FARR plugin: FarrWebMetaSearch 1.4.2
    « Reply #46 on: April 26, 2010, 03:48 AM »
    ... I needed Google search (strange that nobody has asked for that yet?), especially with calculator and converter support - that is, I wanted to be able to input "50 eur in usd" and get the answer from Google. "50 km in miles" works too. ...
    The reason for this is that there's s.newave's GooglePlus plugin that covers google search (and in a very sophisticated way). Not sure if it can do conversions and stuff though.

    Anyway, I'll gladly include your google search in the next Farr WMS release.

    Alien282

    • Participant
    • Joined in 2010
    • *
    • default avatar
    • Posts: 6
      • View Profile
      • Donate to Member
    Re: FARR plugin: FarrWebMetaSearch 1.4.2
    « Reply #47 on: April 26, 2010, 12:55 PM »
    Yes: you just set it in your definition -- simple html format works fine. something like
    Code: HTML [Select]
    1. <i>$2</i>
    works OK: I've used that in my onelook search.
    -Perry Mowbray (April 25, 2010, 03:09 AM)

    hm, the markup from Google contains <em></em> tags, but I don't see any effect in FARR (other than they are gone from the text). Probably if I could do search and replace in the results... :D

    The reason for this is that there's s.newave's GooglePlus plugin that covers google search (and in a very sophisticated way). Not sure if it can do conversions and stuff though.

    Yes, I have GooglePlus, but as you said it doesn't have the calculator/converter support which is actually the thing I wanted the most. Here, having regular expressions, that's easy enough. :) Otherwise, the google search is not that useful, because you can't see the WHOLE description and the keywords found aren't highlighted (that is why I was asking about the em tags).

    skajfes

    • Honorary Member
    • Joined in 2008
    • **
    • Posts: 267
      • View Profile
      • Donate to Member
    Re: FARR plugin: FarrWebMetaSearch 1.4.2
    « Reply #48 on: April 30, 2010, 07:46 PM »
    How can I copy the result to clipboard?
    It is impossible to make anything foolproof because fools are so ingenious.

    ewemoa

    • Honorary Member
    • Joined in 2008
    • **
    • Posts: 2,922
      • View Profile
      • Donate to Member
    Re: FARR plugin: FarrWebMetaSearch 1.4.2
    « Reply #49 on: June 23, 2010, 03:48 PM »
    I'd like to be able to specify local files for searchUrl (e.g. for a local copy of the autohotkey script listing page).

    Is it possible to do this already and if so, is there a way to do it without specifying absolute paths?

    You mean instead of searching in a file downloaded from the web, you want to search in a local file?
    Any chance you might be motivated to work on this?

    I'd like to use it for things like:

      http://www.stoicjoke...ain.php?Target=WinXP