2
0

chore: change module name after fork

This commit is contained in:
2023-06-01 23:40:59 +03:00
parent e3016d532e
commit 8e074e2cca
3 changed files with 17 additions and 16 deletions
+14 -13
View File
@@ -1,11 +1,12 @@
# Go/Golang package for parsing user agent strings [![GoDoc](https://godoc.org/github.com/mileusna/useragent?status.svg)](https://godoc.org/github.com/mileusna/useragent)
# Go/Golang package for parsing user agent strings [![GoDoc](https://godoc.org/github.com/andoma-go/useragent?status.svg)](https://godoc.org/github.com/andoma-go/useragent)
Use `useragent.Parse(userAgent string)` function to parse browser's and bot's user agents strings and get:
+ User agent name and version (Chrome, Firefox, Googlebot, etc.)
+ Operating system name and version (Windows, Android, iOS etc.)
+ Device type (mobile, desktop, tablet, bot)
+ Device name if available (iPhone, iPad, Huawei VNS-L21)
+ URL provided by the bot (http://www.google.com/bot.html etc.)
- User agent name and version (Chrome, Firefox, Googlebot, etc.)
- Operating system name and version (Windows, Android, iOS etc.)
- Device type (mobile, desktop, tablet, bot)
- Device name if available (iPhone, iPad, Huawei VNS-L21)
- URL provided by the bot (http://www.google.com/bot.html etc.)
## Status
@@ -14,8 +15,9 @@ Stable. I use it on high traffic websites on every single request, as well on my
I constantly improve user agents detection and performance. Fill free to report an issue for any User-Agent string not recognized or misinterpreted.
## Installation <a id="installation"></a>
```
go get github.com/mileusna/useragent
go get github.com/andoma-go/useragent
```
## Example<a id="example"></a>
@@ -27,7 +29,7 @@ import (
"fmt"
"strings"
"github.com/mileusna/useragent"
"github.com/andoma-go/useragent"
)
func main() {
@@ -82,7 +84,9 @@ Beside `UserAgent{}` struct and its properties returned by `useragent.Parse()`,
// do something
}
```
can be also written on this way:
```go
ua := useragent.Parse(userAgentString)
if ua.IsAndroid() && ua.IsChrome() {
@@ -92,8 +96,5 @@ can be also written on this way:
## Notice
+ Opera and Opera Mini are two browsers, since they operate on very different ways.
+ If Googlebot (or any other bot) is detected and it is using its mobile crawler, both `bot` and `mobile` flags will be set to `true`.
- Opera and Opera Mini are two browsers, since they operate on very different ways.
- If Googlebot (or any other bot) is detected and it is using its mobile crawler, both `bot` and `mobile` flags will be set to `true`.
+1 -1
View File
@@ -1,3 +1,3 @@
module github.com/mileusna/useragent
module github.com/andoma-go/useragent
go 1.14
+1 -1
View File
@@ -5,7 +5,7 @@ import (
"strings"
"testing"
ua "github.com/mileusna/useragent"
ua "github.com/andoma-go/useragent"
)
var testTable = [][]string{