Revolutionize Your Workflow: Unleash the Power of fm-uri, Your Ultimate Claris/FileMaker Pro Companion for Seamless URL Mastery!
Explore the docs »
Report Bug
·
Request Feature
Table of Contents
Introducing fm-uri, a compact yet powerful custom function tailored for Claris/FileMaker users! This innovative function seamlessly dissects any URL, extracting its vital components and elegantly presents them to you.
As the demand for bridging Claris/FileMaker with the expansive realms of AWS and REST APIs continues to grow, fm-uri emerges as the indispensable solution. Elevate your experience by effortlessly navigating and leveraging the intricate details of URLs with this essential tool. Streamline your workflow and embrace the synergy between Claris/FileMaker and the dynamic world of modern APIs. Uncover the potential of fm-uri as it empowers you to seamlessly integrate and unlock new possibilities in your endeavors.
- Claris Pro
- No 3rd party plugins.
- Effortless URL Parsing: Seamlessly dissect any URL, effortlessly extracting its vital components for streamlined use.
- Intuitive Functionality: A user-friendly custom function that takes a URL and a key, providing specific parts of the URL with simplicity and precision.
- Versatility without 3rd Party Dependencies: Built exclusively for Claris Pro with no reliance on third-party plugins, ensuring reliability and independence.
- Modern JSON Function Integration: Utilizes the power of JSON Functions introduced in FileMaker 16 for a modern and efficient user experience.
- Extensive Key Options: Choose from a comprehensive list of keys to retrieve specific URL details, offering flexibility and customization.
Elevate your Claris/FileMaker experience with fm-uri, where innovation meets practicality, and URL mastery becomes an integral part of your dynamic workflow.
To make the most of fm-uri, ensure your Claris/FileMaker environment meets the following prerequisites:
- FileMaker Version: The custom function relies on the JSON Functions introduced in FileMaker 16. Therefore, it is compatible with FileMaker 16 and later versions.
Note: Using this custom function with versions earlier than FileMaker 16 may result in unexpected behavior.
With these prerequisites in place, you can seamlessly integrate fm-uri into your Claris/FileMaker workflow, unlocking its full potential for URL mastery.
The queryJson
key currently has limitations in handling certain types of query strings, specifically those attempting to encode array parameters. For example:
foo[]=1&foo[]=2
The result will be:
{"foo[]":"1","foo[]":"2"}
Additionally, the queryJson
key does not encode integers, resulting in all values being encoded as strings.
Integrating fm-uri into your Claris/FileMaker file is a breeze. Follow these simple steps:
- Open the fm-uri.fmfn file.
- Copy the code directly from the file.
- Paste the code into the custom function area of your Claris/FileMaker file.
That's it! You're ready to harness the power of fm-uri for seamless URL management.
Below is a representation of how we break up the url
origin __________|__________ / \ authority | __________|_________ | / \ userinfo host resource | __|___ ___|___ __________|___________ | / \ / \ / \ username password hostname port path & segment query fragment | __|___ __|__ ______|______ | __________|_________ ____|____ | | / \ / \ / \ / \ / \ / \ / \ foo://username:[email protected]:123/hello/world/there.html?name=ferret#foo \_/ \ / \ \ / \__________/ \ \__/ | | \ | | \ | scheme subdomain \ tld directory \ suffix \____/ \___/ | | domain filename
The function signature is straightforward and powerful:
/**
* fm-uri ( url ; key )
*
* @author Steven McGill <[email protected]>
* @param string url The url you want to break up
* @param string key The url part you want to return
*
* @return string|object Can either be a string or JSON object when key = all
*
*/
fmUri ( url ; key );
Tailor your URL extraction with a variety of keys available in the custom function:
protocol
can also be used and is an alias ofscheme
fmUri ( "http://example.org/foo/hello.html" ; "scheme" ) // returns "http"
fmUri ( "http://example.org/foo/hello.html" ; "protocol" ) // returns "http"
fmUri ( "http://user:[email protected]/foo/hello.html" ; "username" ) // returns "user"
fmUri ( "http://user:[email protected]/foo/hello.html" ; "password" ) // returns "pass"
fmUri ( "http://example.org/foo/hello.html" ; "hostname" ) // returns "example.org"
fmUri ( "http://example.org:8080/foo/hello.html" ; "hostname" ) // returns "8080"
fmUri ( "http://example.org:80/foo/hello.html" ; "host" ) // returns "example.org:80"
Userinfo is comprised of username and password
fmUri ( "http://user:[email protected]:88/foo/hello.html" ; "userinfo" ) // returns "user:pass"
Authority is comprised of username, password, hostname and port
fmUri ( "http://user:[email protected]:88/foo/hello.html" ; "authority" ) // returns "user:[email protected]:88"
Origin is comprised of the scheme and authority.
fmUri ( "http://example.com/foo.html?q=hello" ; "origin" ) // returns "http://example.com"
fmUri ( "http://example.org/foo/hello.html" ; "domain" ) // returns "example.org"
fmUri ( "http://example.org/foo/hello.html" ; "subdomain" ) // returns "example.org"
fmUri ( "http://example.org/foo/hello.html" ; "tld" ) // returns "org"
path
can also be used and is an alias ofpathname
fmUri ( "http://example.org/foo/hello.html" ; "pathname" ) // returns "/foo/hello.html"
fmUri ( "http://example.org/foo/hello.html" ; "path" ) // returns "/foo/hello.html"
fmUri ( "http://example.org/foo/hello.html" ; "directory" ) // returns "/foo" (no trailing slash)
fmUri ( "http://example.org/foo/hello.html" ; "filename" ) // returns "hello.html" (no leading slash)
fmUri ( "http://example.org/foo/hello.html" ; "suffix" ) // returns "html" (no leading dot)
fmUri ( "http://example.org/foo/hello.html?foo=bar&bar=baz" ; "search" ) // returns "?foo=bar&bar=baz" (leading ?)
fmUri ( "http://example.org/foo/hello.html?foo=bar&bar=baz" ; "query" ) // returns "foo=bar&bar=baz" (no leading ?)
fmUri ( "http://example.org/foo/hello.html?foo=bar&bar=baz" ; "query" ) // returns "{"foo":"bar","bar":"baz"}"
fmUri ( "http://example.org/foo/hello.html#world" ; "hash" ) // returns "#world" (leading #)
fmUri ( "http://example.org/foo/hello.html#world" ; "fragment" ) // returns "world" (no leading #)
fmUri ( "http://example.org/foo/hello.html?query=string#hash" ; "resource" ) // returns "/foo/hello.html?query=string#hash"
fmUri ( "foo://username:[email protected]:123/hello/world/there.html?name=ferret#foo" ; "all" )
/**
* returns
* {
* "authority": "username:[email protected]:123",
* "directory": "/hello/world",
* "domain": "example.com",
* "filename": "there.html",
* "fragment": "foo",
* "hash": "#foo",
* "host": "www.example.com:123",
* "hostname": "www.example.com",
* "origin": "foo://username:[email protected]:123",
* "password": "password",
* "path": "/hello/world/there.html",
* "pathname": "/hello/world/there.html",
* "port": "123",
* "protocol": "foo",
* "query": "name=ferret",
* "resource": "/hello/world/there.html?name=ferret#foo",
* "scheme": "foo",
* "search": "?name=ferret",
* "subdomain": "www",
* "suffix": "html",
* "tld": "com",
* "userinfo": "username:password",
* "username": "username"
* }
*
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE
for more information.
Steven McGill - WhiteSpace Systems Ltd - [email protected]