useragent

package module
v0.0.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 6, 2023 License: MIT Imports: 7 Imported by: 59

README

useragent

A comprehensive and categorized collection of User Agents.

Installation Instructions

To install the useragent tool, use the following command:

go install -v github.com/projectdiscovery/useragent/cmd/ua@latest

Usage

To display help for the tool, use the following command:

ua -h

This will display all the flags supported by the tool:

ua is a straightforward tool to query and filter user agents

Usage:
  ./ua [flags]

Flags:
   -list              list all the categorized tags of user-agent
   -l, -limit int     number of user-agent to list (use -1 to list all) (default 10)
   -t, -tag string[]  list user-agent for given tag

The useragent tool is designed to be simple and efficient, making it easy to query and filter user agents based on your specific needs.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FilterMap map[string]Filter

FilterMap contains filter and its respective function signature

View Source
var UserAgents []*UserAgent

UserAgents of the package

Functions

func Apple

func Apple(userAgent *UserAgent) bool

Apple checks if the user agent has typical apple tags

func Bot

func Bot(userAgent *UserAgent) bool

Bot checks if the user agent has typical bot tags

func Chrome

func Chrome(userAgent *UserAgent) bool

Chrome checks if the user agent has typical chrome tags

func ContainsTags

func ContainsTags(userAgent *UserAgent, tags ...string) bool

ContainsTags returns true if the user agent contains all provided tags

func ContainsTagsAny

func ContainsTagsAny(userAgent *UserAgent, tags ...string) bool

ContainsTagsAny returns true if the user agent contains any of the provided tags

func Desktop

func Desktop(userAgent *UserAgent) bool

Desktop checks if the user agent has typical desktop tags

func GoogleBot

func GoogleBot(userAgent *UserAgent) bool

Google Checks if the user agent has typical GoogleBot tags

func Legacy

func Legacy(userAgent *UserAgent) bool

Legacy checks if the user agent falls under legacy category

func Mobile

func Mobile(userAgent *UserAgent) bool

Mobile checks if the user agent has typical mobile tags

func Mozilla

func Mozilla(userAgent *UserAgent) bool

Mozilla checks if the user agent has typical mozilla firefox tags

func Safari

func Safari(userAgent *UserAgent) bool

Safari checks if the user agent has typical safari tags

func Windows

func Windows(userAgent *UserAgent) bool

Windows checks if the user agent has typical windows tags

Types

type Filter

type Filter func(*UserAgent) bool

Filter represent the function signature for a filter

type UserAgent

type UserAgent struct {
	Tags []string
	Raw  string
}

UserAgent with tags

func Pick

func Pick(n int) ([]*UserAgent, error)

Pick n items randomly from the available ones

func PickWithFilters

func PickWithFilters(n int, filters ...Filter) ([]*UserAgent, error)

Pick n items randomly for the available ones with optional filtering

func (*UserAgent) String

func (userAgent *UserAgent) String() string

String returns the user agent raw value

Directories

Path Synopsis
cmd
ua

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL