I wanted to integrate this functionality into a much larger shortcut, but this blog post will highlight just the domain parsing bit.
This will get you the whole domain name from any given URL from the share sheet. That being said, I wanted to take it a step further and get just the hostname out of the domain name:
Assuming that there is more than two parts to the domain name, this works. But if you have and "A" type of url "blah.com" instead of a "CNAME" type like: "www.blah.com", you're going to get "com" as a result. So your milage may vary.
Anyway, here's a way to do it. Hopefully this blog post helps someone trying to figure out the same issue. It's a little hacky, but knock yourself out.
Please leave comments below.
Please leave comments below.
No comments:
Post a Comment