usable-url is a minuscule suite that resolves potentially unusable urls. If you need expansion for a shortened url or url with a missing prefix (e.g wikipedia.org instead of https://www.wikipedia.org) usable-url could help
Behind the scenes this program use cURL. cURL should have been installed in your computer to use this program.
go get github.com/gusanmaz/usable-url
go install ${GOPATH}/src/github.com/gusanmaz/usable-url/cmd/cli/usable-url-cli.go
go install ${GOPATH}/src/github.com/gusanmaz/cmd/usable-url/server/usable-url-server.go
- Import
github.com/gusanmaz/usableurl
into your project - Call usableURL.Sanitize("your unprocessed url goes here")
usable-url-cli --url google.com
This command should return https://www.google.com
usable-url-server --port 8081
If you don't specify the port, it defaults to 9001- type
localhost:8081/?url=google.com
into your browser's address bar. - Upon enter you could receive a JSON response similar to:
{
"In": "google.com",
"Out": "http://www.google.com/"
}
Güvenç Usanmaz
MIT License