Use a web viewer that links to one of the many services that gives you the WAN address, and scrape the web viewer content.
Or use Insert From URL to do the same with the resulting site's code in a text field.
I always use ipchicken.com, funny name but easy to remember.
I created the text field and have added the Insert from URL (www.ipchicken.com) using the script step.
It is copying the source code . How can I make it display only the IP address ?
I will try it out
thats nice , Thank you
1 of 1 people found this helpful
Thank you all for the replies.
I found a more simple way without web scraping , which i tried and is working for me
Here's how to do it
1) If you point your web browser at http://checkip.dyndns.org
You’ll see a very simple html page showing your WAN IP Address.
2)We can use the Insert From URL script step to populate a field in a Filemaker table:
3)Create a Filemaker Script
Insert From URL [select ; No Dialog ; filemaker::field ; "http://checkip.dyndns.org" ]
4) Use the simple Filter function:
Filter ( filemaker::field ; "0123456789.")
We then have the WAN IP address, sitting on it’s own, in a Filemaker field. From here of course, we can then use this information to trigger notification scripts if the IP is not on a whitelist, or any thing else we need.
NOTE There’s two easy ways to get around this logging, if you wish. First, with administrator level privileges, and Filemaker Advanced, a user could intervene in the script process, thus avoiding the logging. Also, there are ways in which the client machine could spoof it’s WAN IP, thus giving spurious results in the Insert From URL step. All in all, these are limitations of any client-side logging feature, so be sure to assess the potential impact before implementing…
well, I'm a dyndns.org customer but didn't know that link. I can say:
- the html-code is very slim and therefor serves best for this purpose
- DynDNS.org already exists for many years. Great chances that they won't change this site soon
(if though, you would have to change the text-extraction formula!)
But in forewarning, if they DO decide to place a single digit or additional period in their web code, your solution will break.
It’s best to scrape something between identifiable tags, so you KNOW that you’re getting the right result. Filtering an entire rendered website for characters is a bad idea from a “set it and forget it” standpoint. You are trusting your solution to a third party variable, something I try to avoid as best as possible.
six to one, half dozen to the other. If it works for you and is simpler to understand than full blown web scraping, more power to you.
Thank you , I was in bit of hurry so found it to be an easier way for now. I think I will replace it to the web scraping method to be safer .
Recently 24U has released Toolbox 2.0 which features a function that will do this for you without having to insert from URL and scrape...
Set field (Client_IP; Toolbox_GetClientPublicIPAddress)
or create a calculated text field with the definition "Toolbox_GetClientPublicIPAddress"
This is as easy as using any Get().
I use it in a calculated field in a startup script when I create a record. Since the user is logging into a hosted file, they have Internet access and it works.
A better URL for finding your external IP is: ipecho.net/plain
This only returns the URL as text, with no HTML nonsense or other text/formatting.
so this is what i use:
insert from URL [Select ; with dialog OFF ; newIP ; "ipecho.net/plain"]
where newIP is the designated field to hold the iP address