Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wux1an/fake-useragent
Provide random user agent
https://github.com/wux1an/fake-useragent
crawler random spider ua user-agent useragent
Last synced: about 5 hours ago
JSON representation
Provide random user agent
- Host: GitHub
- URL: https://github.com/wux1an/fake-useragent
- Owner: wux1an
- License: bsd-3-clause
- Created: 2021-11-08T13:18:59.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-07-14T13:01:05.000Z (over 2 years ago)
- Last Synced: 2023-07-12T13:17:42.634Z (over 1 year ago)
- Topics: crawler, random, spider, ua, user-agent, useragent
- Language: Go
- Homepage:
- Size: 33.2 KB
- Stars: 11
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# fake-useragent
Provide random user agent
# Install
```console
go get -u github.com/wux1an/fake-useragent
```# Usage
```golang
package mainimport (
"fmt"
"github.com/wux1an/fake-useragent"
)func main() {
fmt.Println(ua.Random())
fmt.Println(ua.RandomType(ua.Desktop))
fmt.Println(ua.RandomType(ua.Mobile))
fmt.Println(ua.RandomType(ua.Chrome))
}// Output:
// Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0.1 Safari/605.1.15
// Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36
// Mozilla/5.0 (Linux; Android 8.1.0; Moto G (5S)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.80 Mobile Safari/537.36
// Mozilla/5.0 (Linux; Android 7.1; vivo 1716 Build/N2G47H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.98 Mobile Safari/537.36
```