topbanner_forum
  *

avatar image

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

Login with username, password and session length
  • Thursday March 28, 2024, 5:55 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

Author Topic: [Feature request/Plugin idea] add search in dictionary.com  (Read 13170 times)

Werizon

  • Supporting Member
  • Joined in 2010
  • **
  • Posts: 25
    • View Profile
    • Donate to Member
Just a request
I use dictionary.com very often and it would be great if I could
search definitions on this site in FARR

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: [Feature request/Plugin idea] add search in dictionary.com
« Reply #1 on: May 08, 2010, 03:40 PM »
type in the search bar:
define WHATEVERWORDYOUWANTHERE

the included "define" alias already knows about 15 different dictionary websites it can search, including dictionary.com

Werizon

  • Supporting Member
  • Joined in 2010
  • **
  • Posts: 25
    • View Profile
    • Donate to Member
Re: [Feature request/Plugin idea] add search in dictionary.com
« Reply #2 on: May 12, 2010, 10:50 AM »
oh great:]
i have to read help, maybe i find other treasures:]
thanks for replaying

one more question;p
is there any chance to add urbandictionary to this list?

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: [Feature request/Plugin idea] add search in dictionary.com
« Reply #3 on: May 12, 2010, 10:53 AM »
is there any chance to add urbandictionary to this list?

good idea, i will do so for next release.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: [Feature request/Plugin idea] add search in dictionary.com
« Reply #4 on: May 12, 2010, 11:07 AM »
if you want to use it now, unpack this into your FindAndRunRobot/AliasGroups/Installed/Core_Aliases folder

* Core_Aliases.zip (2.78 kB - downloaded 213 times.)

Werizon

  • Supporting Member
  • Joined in 2010
  • **
  • Posts: 25
    • View Profile
    • Donate to Member
Re: [Feature request/Plugin idea] add search in dictionary.com
« Reply #5 on: May 12, 2010, 05:19 PM »
thank you:]

now i see how to add my own searches:]
thank you again:]
Find and Run Robot is incredible:]

another question, the last one;p
is there any easy way that i can get result page displayed in  Find and Run Robot window?

is there any easy way to achieve this:
i added this search to file you posted http://www.ling.pl/i...exalt.php?word=brick
and i know that important part of html that i want to see in application window is between <div id='main'></div>
is there a way to put only this part in my Find and Run Robot window?
 
« Last Edit: May 12, 2010, 05:35 PM by Werizon »

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: [Feature request/Plugin idea] add search in dictionary.com
« Reply #6 on: May 12, 2010, 05:32 PM »
two comments:

now i see how to add my own searches:

keep in mind that you shouldn't edit and modify the alias files in the "Installed" subdirectory (like where the Core-Linguistics.alias file is), because it will get overwritten when FARR is updated(!).  If you really wanted to make your own define alias you could first COPY it from that alias file into your own one in the "MyCustom" alias directory, and disable the built-in one so yours is used instead.  It's a bit tricky but it lets us keep the build in aliases updated.

is there any easy way that i can get result page displayed in  Find and Run Robot window?

there is, but you'll have to make your own custom alias for that.  to do this, check out the "igo" alias in the Core-Internet.alias file (note that you can view and edit these alias files from within FARR in the Alias/Groups tab, or edit the files directly with a text editor).

the igo alias uses the following result to show a web page in the internal farr window:
Internal Surf to $$1 | htmlviewurl $$1

so you see all you have to do is specify "htmlviewurl" in front of the url to have it opened internally.

good luck creating your own custom aliases! :)

Werizon

  • Supporting Member
  • Joined in 2010
  • **
  • Posts: 25
    • View Profile
    • Donate to Member
Re: [Feature request/Plugin idea] add search in dictionary.com
« Reply #7 on: May 12, 2010, 05:41 PM »
ok this is really last question;p

is there a way to display only part of page i mean something like this

i add sutom alias i.e. http://www.ling.pl/indexalt.php?word=$$1
and i know that important part of html that i want to see in application window is between <div id='main'></div>
is there a way to put only this part in my Find and Run Robot window?

i understand tha i can sometimes need to load the whole page to display site correctly
but is there a way to hide everything besides interesting part "<div id='main'></div>"

sorry for my english

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: [Feature request/Plugin idea] add search in dictionary.com
« Reply #8 on: May 12, 2010, 05:45 PM »
is there a way to put only this part in my Find and Run Robot window?

now that is a great question.. the answer is no, and maybe in future.

there is no currently easy way to do what you want.

the ability to specify a regex to apply on a webpage before displaying would make for a great plugin -- i hope someone will make it.  there are other plugins that do this kind of thing internally for specific sites, but what we really could use is a plugin that can be invoked by aliases that do exactly what you are wanting, take a url and a regex pattern to match to build what to display and then display it.

there is also the WebMetaSearch plugin which is infinitely more complex than what you are requesting, and isn't really suited for what you want, but is related so i thought i'd mention it.

ewemoa

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 2,922
    • View Profile
    • Donate to Member
Re: [Feature request/Plugin idea] add search in dictionary.com
« Reply #9 on: May 12, 2010, 08:28 PM »
The following has some possibly related info:

  https://www.donationcoder.com/forum/index.php?topic=12128.msg137164#msg137164
« Last Edit: May 12, 2010, 08:43 PM by ewemoa »

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: [Feature request/Plugin idea] add search in dictionary.com
« Reply #10 on: May 12, 2010, 08:32 PM »
ewe is being modest as always.. it's not "possibly related", it's actually a plugin that ewemoa made that is exactly what you want.

ewemoa

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 2,922
    • View Profile
    • Donate to Member
Re: [Feature request/Plugin idea] add search in dictionary.com
« Reply #11 on: May 12, 2010, 08:44 PM »
The version of Webgrab mentioned in the aforementioned topic is dated.  Below is a link to one that seems to work for some cases:

  http://ewemoa.dcmemb....com/tmp/Webgrab.zip

Usage:

  webgrab <url> {<regular-expression>} "<template-string>"

Example:
         
  webgrab http://www.weather.c.../weather/local/08080 {<div class="ccTemp">(\d+)} "Temperature in your town is %1 degrees"

If there is interest, perhaps this version can be modified appropriately or a separate implementation can be attempted.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: [Feature request/Plugin idea] add search in dictionary.com
« Reply #12 on: May 12, 2010, 08:59 PM »
I think webgrab would have to be modified to optionally display the result in html mode, as it currently tries to display results in memo mode.

<mouser> what you need is an option to allow it to output to html mode
<mouser> you could simply autodetect by looking for one of some common text
<mouser> like
<mouser> <p> <a href or <div or <ul
<mouser> if any of those are found, use the showhtml
<mouser> instead of showmemo

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: [Feature request/Plugin idea] add search in dictionary.com
« Reply #13 on: May 12, 2010, 09:00 PM »
also this would be a perfect case where pcommand would be useful -- so that one doesnt have to change the search text with restartsearch in order to trigger it.

ewemoa

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 2,922
    • View Profile
    • Donate to Member
Re: [Feature request/Plugin idea] add search in dictionary.com
« Reply #14 on: May 13, 2010, 07:03 AM »
mouser found plenty of things to improve in the latest available version so I'm working on addressing some of those things.

Hope to have some news on this before long.

ewemoa

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 2,922
    • View Profile
    • Donate to Member
Re: [Feature request/Plugin idea] add search in dictionary.com
« Reply #15 on: May 13, 2010, 09:11 AM »
is there a way to display only part of page i mean something like this

i add sutom alias i.e. http://www.ling.pl/indexalt.php?word=$$1
and i know that important part of html that i want to see in application window is between <div id='main'></div>
is there a way to put only this part in my Find and Run Robot window?

i understand tha i can sometimes need to load the whole page to display site correctly
but is there a way to hide everything besides interesting part "<div id='main'></div>"

Depending on what it is you want to do, I think you may be disappointed in Webgrab.  The plugin lets you extract information from HTML and reformat, but it's not going to get you images, style sheets, etc.

But, FWIW, below is the latest:

  http://ewemoa.dcmemb....com/tmp/Webgrab.zip

SHA1: 6e83bda1a192dfee82b1a1e94458de89ab071c80

Usage has changed since earlier.  A snippet from the included README.txt:

  In the 'Result(s) - programs, ...' text area of the Edit Alias Dialog, one might specify:

    pcommand webgrab http://www.urbandict...com/define.php?term=$$u1 `<table id='entries'>([\s\S]*)<div id='paginator'>` `%1` html

  The URL (what to get) is:

    http://www.urbandict...com/define.php?term=$$u1

the regular expression (what to pay attention to) is:

    <table id='entries'>([\s\S]*)<div id='paginator'>

and the template string (how to present) is:

    %1

  N.B. The latter two are surrounded by backticks ` to help the plugin understand what information it is being given.

  This example alias ends with:

    html

which tells Webgrab to display the results as HTML.

  This example makes use of user input, so it is important to specify an appropriate value for "Regular Expression Pattern".  For example, if "Alias Trigger Text" has the value:

    testwg

  One might specify a value of:

    ^testwg (.*)

  for "Regular Expression Pattern".

  Reminder: a backtick character ` is used for quoting the regular expression and the formatting template.

The README.txt contains more detail and examples.

Please note that the backtick character ` (the backwards single quote) is used for surrounding the regular expression and the template string.

ewemoa

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 2,922
    • View Profile
    • Donate to Member
Re: [Feature request/Plugin idea] add search in dictionary.com
« Reply #16 on: May 15, 2010, 04:32 PM »
Below is another example use:

webgrab donationcoder | pcommand webgrab https://www.donationcoder.com `<!-- DCAP- LEFTSIDEBAR TOP SUPERSHORT -->[^<]+<p class="sph">([^<]+)</p>[^<]+<p class="sp"><img src="[^"]+" alt=""/>([^<]+)</p>[^<]+<p class="sp"><a href\s*=\s*"([^"]+)">([^<]+)</a></p>` `%1 %2 <a href="https://www.donationcoder.com%3">%4</a>` html

Note that when constructing regular expressions, one may have less problems if working off of the original HTML source from the server and not the "processed" version.  Specifically, under Firefox, "View Selection Source" will provide "DOM Source of Selection", while "View Page Source" will give something that is closer to (if not) the original HTML source.  There were at least two differences that showed up while working on the example above.
« Last Edit: May 15, 2010, 04:38 PM by ewemoa »

ewemoa

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 2,922
    • View Profile
    • Donate to Member
Re: [Feature request/Plugin idea] add search in dictionary.com
« Reply #17 on: May 15, 2010, 05:02 PM »
An example for latest topic at DC forums:

webgrab donationcoder - latest topic | pcommand webgrab https://www.donationcoder.com/forum/index.php?action=rtopicsdense;sort=creation `Creation Date</td>[^<]+</tr></tr><tr><td colspan="5"><hr/></td></tr>[^<]+<tr>[^<]+<td align="right" valign="middle" nowrap="nowrap" class="smalltext">\[([^\]]+)\]</td>[^<]+<td valign="top" class="orangemed"><a href="([^"]+)">([^<]+)</a></td>` `[%1] <a href="%2">%3</a>` html

This is just for illustration purposes, FarrWebMetaSearch might be more appropriate for this type of thing (especially if you want to see more than one topic).

Werizon

  • Supporting Member
  • Joined in 2010
  • **
  • Posts: 25
    • View Profile
    • Donate to Member
Re: [Feature request/Plugin idea] add search in dictionary.com
« Reply #18 on: May 27, 2011, 04:39 AM »
Does Webgrab working in newest FARR ? i cant get it work now only something about 0 results displays

phitsc

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 1,198
    • View Profile
    • Donate to Member
Re: [Feature request/Plugin idea] add search in dictionary.com
« Reply #19 on: May 27, 2011, 07:49 AM »
I was thinking / playing around with something similar recently. Basically, what I want is make use of the feature DuckDuckGo calls zero-click. Google and Yahoo have it as well, although I don't know if they have given it a name (they probably did). When you use one of these search engines, they will show some info relevant to your search which is not a URL search result item right at the top. I think these are perfect for use within FARR. E.g. I want to type stuff like:
alias 10€ to $
alias translate donation to german
alias 123 * 456
etc.

I want an alias like search offering searching for a supplied phrase in both google and duckduckgo, but show the result in FARR's internal html view (like igo does). Actually, I've made an alias that does just that, but there are certain things that don't seem to work as expected. I'll make a separate post describing my findings.

Werizon

  • Supporting Member
  • Joined in 2010
  • **
  • Posts: 25
    • View Profile
    • Donate to Member
Re: [Feature request/Plugin idea] add search in dictionary.com
« Reply #20 on: May 27, 2011, 02:54 PM »
Ok Webgrab is working now:p

I have another question
How to add allias
I mean
i have command like this
webgrab http://dictionary.reference.com/browse/$$1 `<div id="rpane">([\s\S]*)<div id="v2" class="sep_top">` `%1` html

and i want to run this by command like dict $$1

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: [Feature request/Plugin idea] add search in dictionary.com
« Reply #21 on: May 29, 2011, 09:34 AM »
Hi Werizon,

Your question is a perfect one for using the webgrab plugin, and ewemoa, the author of the webgrab plugin, suggested the solution to me in a personal message:
You can accomplish what you want using the dosearchontrigger command.

Here is the alias import text; you can go to the alias tab, open up myaliases.alias and right-click to "import" this:
Code: Text [Select]
  1. 1000>>>mdict>->search reference.com for "$$1" | dosearchontrigger webgrab http://dictionary.reference.com/browse/$$1 `<div id="rpane">([\s\S]*)<div id="v2" class="sep_top">` `%1` html>+>^mdict (.+)$

Alternatively here is a screenshot of the alias:
Screenshot - 5_29_2011 , 9_29_31 AM.png

Essentially what you are doing here is telling FARR to *perform* the webgrab "search" after the user types something that matches the expression "mdict blah.." and then hits enter; so this acts as if the user had typed "webgrab http://...." with the $$1 replaced.

Werizon

  • Supporting Member
  • Joined in 2010
  • **
  • Posts: 25
    • View Profile
    • Donate to Member
Re: [Feature request/Plugin idea] add search in dictionary.com
« Reply #22 on: May 30, 2011, 06:13 AM »
Thanks for reply:]
few days ago i thougt about the same solution:] i even make few instant search aliases with dosearch:]
but using instant sometimes causes little lags and something looking like a bug
i mean
when i type slowly everything is alright but typping fast causes losing letters
instead of brick i get bric

sorry for my english:]

ewemoa

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 2,922
    • View Profile
    • Donate to Member
Re: [Feature request/Plugin idea] add search in dictionary.com
« Reply #23 on: May 31, 2011, 07:05 AM »
Did you try dosearchontrigger?

   dosearchontrigger STRING TO SEARCH FOR - doesn't change the editbox but causes FARR to display results as if user had typed the string.  very useful in conjunction with regular expression patterns.  like dosearch but only happens when user hits Enter.