chore: change module name after fork
This commit is contained in:
@@ -1,11 +1,12 @@
|
|||||||
# Go/Golang package for parsing user agent strings [](https://godoc.org/github.com/mileusna/useragent)
|
# Go/Golang package for parsing user agent strings [](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:
|
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.)
|
- User agent name and version (Chrome, Firefox, Googlebot, etc.)
|
||||||
+ Device type (mobile, desktop, tablet, bot)
|
- Operating system name and version (Windows, Android, iOS etc.)
|
||||||
+ Device name if available (iPhone, iPad, Huawei VNS-L21)
|
- Device type (mobile, desktop, tablet, bot)
|
||||||
+ URL provided by the bot (http://www.google.com/bot.html etc.)
|
- Device name if available (iPhone, iPad, Huawei VNS-L21)
|
||||||
|
- URL provided by the bot (http://www.google.com/bot.html etc.)
|
||||||
|
|
||||||
## Status
|
## 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.
|
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>
|
## Installation <a id="installation"></a>
|
||||||
|
|
||||||
```
|
```
|
||||||
go get github.com/mileusna/useragent
|
go get github.com/andoma-go/useragent
|
||||||
```
|
```
|
||||||
|
|
||||||
## Example<a id="example"></a>
|
## Example<a id="example"></a>
|
||||||
@@ -27,7 +29,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/mileusna/useragent"
|
"github.com/andoma-go/useragent"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
@@ -82,7 +84,9 @@ Beside `UserAgent{}` struct and its properties returned by `useragent.Parse()`,
|
|||||||
// do something
|
// do something
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
can be also written on this way:
|
can be also written on this way:
|
||||||
|
|
||||||
```go
|
```go
|
||||||
ua := useragent.Parse(userAgentString)
|
ua := useragent.Parse(userAgentString)
|
||||||
if ua.IsAndroid() && ua.IsChrome() {
|
if ua.IsAndroid() && ua.IsChrome() {
|
||||||
@@ -92,8 +96,5 @@ can be also written on this way:
|
|||||||
|
|
||||||
## Notice
|
## Notice
|
||||||
|
|
||||||
+ Opera and Opera Mini are two browsers, since they operate on very different ways.
|
- 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`.
|
- 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,3 +1,3 @@
|
|||||||
module github.com/mileusna/useragent
|
module github.com/andoma-go/useragent
|
||||||
|
|
||||||
go 1.14
|
go 1.14
|
||||||
|
|||||||
+1
-1
@@ -5,7 +5,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
ua "github.com/mileusna/useragent"
|
ua "github.com/andoma-go/useragent"
|
||||||
)
|
)
|
||||||
|
|
||||||
var testTable = [][]string{
|
var testTable = [][]string{
|
||||||
|
|||||||
Reference in New Issue
Block a user