I was wondering if there was a way to get the website name from the URL, using either JavaScript, or Node-JS.
Here is an example:
https://www.google.com → google
http://www.facebook.com.au → facebook
duckduckgo.com → duckduckgo
material.io → material
I was thinking about filtering out common things like .com
, www.
etc, but then there are country codes, like .au
, .cn
.