All Projects → benbjohnson → agency

benbjohnson / agency

Licence: MIT License
A fast user agent string parser for Go.

Programming Languages

go
31211 projects - #10 most used programming language
Makefile
30231 projects

Agency

Agency is a fast user-agent parser in pure Go. It uses a simple tokenizer and weighted tokens to determine the correct device type, category and browser.

Usage

To use Agency, simply import the package and call Scan():

import "github.com/benbjohnson/agency"

ua := agency.Scan("Mozilla/5.0 (Windows NT 6.2; Win64; x64) AppleWebKit/537.36 blah blah...")

User Agent Info

The Scan() function returns a UserAgent with the following string properties:

Type
----------
Desktop
Tablet
Mobile

Category
----------
Windows
Mac
Linux
iOS
Blackberry
Android

Browser
----------
Chrome
Safari
Internet Explorer
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].