All Projects → mssola → User_agent

mssola / User_agent

Licence: mit
HTTP User Agent parser for the Go programming language.

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Projects that are alternatives of or similar to User agent

Ng Device Detector
Angular module to detect OS / Browser / Device
Stars: ✭ 243 (-57.96%)
Mutual labels:  user-agent, useragent
bots-zoo
No description or website provided.
Stars: ✭ 59 (-89.79%)
Mutual labels:  user-agent, useragent
uainfer
Infer the user agent from its User Agent string
Stars: ✭ 21 (-96.37%)
Mutual labels:  user-agent, useragent
React Device Detect
Detect device, and render view according to detected device type.
Stars: ✭ 1,145 (+98.1%)
Mutual labels:  user-agent, useragent
useragent-generator
Easily generate correct user-agent strings for popular browsers
Stars: ✭ 62 (-89.27%)
Mutual labels:  user-agent, useragent
browserslist-generator
A library that makes generating and validating Browserslists a breeze!
Stars: ✭ 77 (-86.68%)
Mutual labels:  user-agent, useragent
Browser.php
A PHP Class to detect a user's Browser. This encapsulation provides a breakdown of the browser and the version of the browser using the browser's user-agent string. This is not a guaranteed solution but provides an overall accurate way to detect what browser a user is using.
Stars: ✭ 546 (-5.54%)
Mutual labels:  user-agent, useragent
egjs-agent
Extracts browser and operating system information from the user agent string or user agent object(userAgentData).
Stars: ✭ 73 (-87.37%)
Mutual labels:  user-agent
Ngx Responsive
Superset of RESPONSIVE DIRECTIVES to show or hide items according to the size of the device screen and another features in Angular 9
Stars: ✭ 300 (-48.1%)
Mutual labels:  useragent
sawmill
Sawmill is a JSON transformation Java library
Stars: ✭ 92 (-84.08%)
Mutual labels:  user-agent
micell
A collection of functions for front-end development
Stars: ✭ 16 (-97.23%)
Mutual labels:  useragent
Browscap
📃 The main project repository
Stars: ✭ 354 (-38.75%)
Mutual labels:  user-agent
Bowser
a browser detector
Stars: ✭ 5,006 (+766.09%)
Mutual labels:  useragent
Curl
A command line tool and library for transferring data with URL syntax, supporting DICT, FILE, FTP, FTPS, GOPHER, GOPHERS, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, MQTT, POP3, POP3S, RTMP, RTMPS, RTSP, SCP, SFTP, SMB, SMBS, SMTP, SMTPS, TELNET and TFTP. libcurl offers a myriad of powerful features
Stars: ✭ 22,875 (+3857.61%)
Mutual labels:  user-agent
Platform.js
A platform detection library.
Stars: ✭ 2,937 (+408.13%)
Mutual labels:  user-agent
flutter ua client hints
Provide User-Agent Client Hints to a Flutter app.
Stars: ✭ 27 (-95.33%)
Mutual labels:  useragent
Yauaa
Yet Another UserAgent Analyzer
Stars: ✭ 472 (-18.34%)
Mutual labels:  user-agent
vue-if-bot
Hide stuff from bots (especially cookie consents)
Stars: ✭ 62 (-89.27%)
Mutual labels:  user-agent
Useragent Switcher
A User-Agent spoofer browser extension that is highly configurable
Stars: ✭ 261 (-54.84%)
Mutual labels:  user-agent
Agent
👮 A PHP desktop/mobile user agent parser with support for Laravel, based on Mobiledetect
Stars: ✭ 3,891 (+573.18%)
Mutual labels:  user-agent

Build Status for master branch godoc.org page MIT


UserAgent is a Go library that parses HTTP User Agents. As an example:

package main

import (
    "fmt"

    "github.com/mssola/user_agent"
)

func main() {
    // The "New" function will create a new UserAgent object and it will parse
    // the given string. If you need to parse more strings, you can re-use
    // this object and call: ua.Parse("another string")
    ua := user_agent.New("Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11")

    fmt.Printf("%v\n", ua.Mobile())   // => false
    fmt.Printf("%v\n", ua.Bot())      // => false
    fmt.Printf("%v\n", ua.Mozilla())  // => "5.0"

    fmt.Printf("%v\n", ua.Platform()) // => "X11"
    fmt.Printf("%v\n", ua.OS())       // => "Linux x86_64"

    name, version := ua.Engine()
    fmt.Printf("%v\n", name)          // => "AppleWebKit"
    fmt.Printf("%v\n", version)       // => "537.11"

    name, version = ua.Browser()
    fmt.Printf("%v\n", name)          // => "Chrome"
    fmt.Printf("%v\n", version)       // => "23.0.1271.97"

    // Let's see an example with a bot.

    ua.Parse("Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)")

    fmt.Printf("%v\n", ua.Bot())      // => true

    name, version = ua.Browser()
    fmt.Printf("%v\n", name)          // => Googlebot
    fmt.Printf("%v\n", version)       // => 2.1
}

If you want to read the full API documentation simply check godoc.

Installation

go get -u github.com/mssola/user_agent

Contributing

Do you want to contribute with code, or to report an issue you are facing? Read the CONTRIBUTING.md file.

Changelog

Read the CHANGELOG.md file.

License

Copyright (c) 2012-2021 Miquel Sabaté Solà

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
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].