https://github.com/slimdestro/gourlnormalizer
url normalizer[RFC 3986]-Golang
https://github.com/slimdestro/gourlnormalizer
go golang golang-package norm normalization rfc rfc3986 seotools
Last synced: 5 months ago
JSON representation
url normalizer[RFC 3986]-Golang
- Host: GitHub
- URL: https://github.com/slimdestro/gourlnormalizer
- Owner: slimdestro
- License: apache-2.0
- Created: 2022-09-10T21:26:10.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-09-10T22:39:59.000Z (over 3 years ago)
- Last Synced: 2025-04-10T05:42:05.951Z (about 1 year ago)
- Topics: go, golang, golang-package, norm, normalization, rfc, rfc3986, seotools
- Language: Go
- Homepage:
- Size: 10.7 KB
- Stars: 7
- Watchers: 1
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# (+)go-url-normalize[RFC 3986]
#### Normalize URL | Count unique normalized URL | Count unique normalized URL per TLD
[](https://dev.to/slimdestro)
## Installation
Install the package by doing go get:
```sh
go get github.com/slimdestro/gourlnormalizer
```
Three exported methods that you can use in your modules are:
```sh
NormalizeURL(url string)
CountUniqueNormalizedUrls(url []string)
CountUniqueNormalizedUrlsPerTopLevelDomain(url []string)
```
## Example
```sh
package main
import (
"fmt"
"github.com/slimdestro/gourlnormalizer"
)
func main() {
normalizedUrl,_ := normalizer.NormalizeURL("https://example.com?b=2&a=1")
fmt.Println(normalizedUrl)
// compare both url to see what has changed
urls__ := []string{"https://example.com?a=1&b=2", "https://example.com?b=2&a=1"}
fmt.Println(normalizer.CountUniqueNormalizedUrls(urls__))
urls___ := []string{"https://tempo.com", "https://example.com", "https://subdomain.example.com"}
fmt.Println(normalizer.CountUniqueNormalizedUrlsPerTopLevelDomain(urls___))
}
```
## Author
[slimdestro(Mukul Mishra)](https://linktr.ee/slimdestro)