ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > FARR Plugins and Aliases

Farr Plugin Idea Again: Generic web page retrieve with regex show

<< < (2/2)

ewemoa:
A new version (1.0.0.5) should be available now (see previous message above for download location).

This version provides an alias "wgt" which launches an IE window from which one should be able to test various arguments to feed to Webgrab.  One can do testing via this window and once a satisfactory set of arguments is obtained, manually translate them [1] into an alias for later use.


[1] I'm hoping to provide some functionality eventually to "compute" an appropriate alias string so the translation doesn't have to be done manually.  For the moment, one can probably get some idea of what to do to translate based on the pre-installed alias "wgwz".

mouser:
[1] I'm hoping to provide some functionality eventually to "compute" an appropriate alias string so the translation doesn't have to be done manually.
--- End quote ---


this plugin has such incredible potential.. i think once people see what it can be used to do it will open up a whole slew of stuff.

but what do you meant about avoiding manual translation?

ewemoa:
The testing via IE is done by filling in forms in a field -- so there is one field for the URL to fetch, one field for the regular expression to use for matching, and one field for the template to use to build the results. 

In the context of the FARR window (or specifying an alias), the arguments to "webgrab" (i.e. URL, regex string, and template string) are not all exactly in the same format as for the form.  In particular, the latter two must be surrounded by double quotes and consequently (I believe) be escaped appropriately (e.g. if there was a double quote in a regular expression tested in the form context, it would need to be escaped before being used as an argument to the "webgrab" alias [1]).

In general then, if you start w/ the form, come up w/ a set of arguments that works in that context, and then want to save them for later use, say as an alias, you may be faced w/ the task of "translating" them as a straight copy-and-paste will not work (at a minimum you'll need to wrap the regex string and template string in double quotes and depending on the precise content of the two arguments may be faced w/ the task of escaping certain characters).

Is this any clearer?

On a side note, I've also been wondering about potential mismatches between FARR's regular expression handling and that of JS -- I think ecaradec alluded to this in another thread at some point too -- AFAIU, they are not exactly the same.


[1] But in the current implementation, I don't think Webgrab handles double quotes in regex strings or templates :)

Navigation

[0] Message Index

[*] Previous page

Go to full version