topbanner_forum
  *

avatar image

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

Login with username, password and session length
  • Saturday December 14, 2024, 11:42 pm
  • 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: FARR Plugin with fscript  (Read 5714 times)

jpprater

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 90
    • View Profile
    • Donate to Member
FARR Plugin with fscript
« on: April 22, 2008, 01:46 PM »
I'm working on a farr plugin using the fscript javascript SDK.
There's a website that I use with one of my favorite forums.  I'd like to be able to duplicate that site's functionality with FARR.
The site takes as input a URL and several optional arguments.  It returns the URL as base64-encoded with a warning message of some sort based on the selected options.  It acts as a redirector to the site and displays a warning about content.
For instance, if I feed the site the URL "https://www.donationcoder.com" and ask it to display the warning "lots of cool software"... 8) :-*
What I get back is this URL that can redisplay the warning anytime...
http://uftoolbox.inf...ots+of+cool+software
I can assemble the URL easily enough, and I can get initial URL encoded with a library I found, but how would I accept the other arguments?  There are 9 all total.
If I use an alias like "makeredirect", the regex that I match to might look like this...
^makeredirect .* .* .* .* .* .* .* .* .*
And then the result would have to do something like "makeredirect $$1 $$2 $$3 $$4 $$5 $$6 $$7 $$8 $$9", where $$9 would preferably match to a quoted string of some kind.  How would I construct that in FARR using the Javascript SDK?

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,914
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: FARR Plugin with fscript
« Reply #1 on: April 22, 2008, 04:37 PM »
Congratulations on attempting this jpprater!

Your question is very similar to the one raised by kartal here: https://www.donation....msg110539#msg110539

I think what we need is a nice sample regex which can accept any number of multiple space (or comma) separated arguments.  and if its possible to design a regex where double quotes around an argument allows it to contain spaces?

Im not much of a regex expert but i can try to whip something up if the true regex experts dont chime in.

If we come up with a good general purpose regex for this ill put something in the dialog so users can choose this easily.

jpprater

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 90
    • View Profile
    • Donate to Member
Re: FARR Plugin with fscript
« Reply #2 on: April 23, 2008, 06:02 AM »
Congratulations on attempting this jpprater!

Your question is very similar to the one raised by kartal here: https://www.donation....msg110539#msg110539

I think what we need is a nice sample regex which can accept any number of multiple space (or comma) separated arguments.  and if its possible to design a regex where double quotes around an argument allows it to contain spaces?

Im not much of a regex expert but i can try to whip something up if the true regex experts dont chime in.

If we come up with a good general purpose regex for this ill put something in the dialog so users can choose this easily.
OK, so it is something i'd have to work out in the regex.  What type of regex did you program it to recognize?  Is the syntax similar to what Ruby, Python, and Perl use?  I'm only just beginning to understand regex myself.