Giter Site home page Giter Site logo

useragents's Introduction

UserAgents

This library contains useragents.json and small JS library to pick random useragents by pure randomity or by UA Popularity.

Installation

npm --save i useragentsdata 

Use Data in your own app

this is raw access to useragents, so you can process it with your own functions

var { useragents } = require('useragentsdata')
console.log(useragents)

picking a random Useragent

returns an agent object

var { randomUseragent } = require('useragentsdata')
console.log(`Random useragent by popularity:`,randomUseragent(true))
console.log(`Random useragent by randomity:`,randomUseragent(false))

Taking Useragent by BrowserFamily or/and OsFamily

the osFamily is optional

var { UseragentByFamily } = require('useragentsdata')
console.log(`Random Chrome UserAgent on a Mac OS:`,UseragentByFamily('chrome','Mac OS X'))

BrowserFamilies

var { UseragentBrowserFamilies } = require('useragentsdata')
console.log(`Browser Families:\n`,UseragentBrowserFamilies())

returns

 [ 'Chrome',
  'Firefox',
  'QQ Browser',
  'Other',
  'Yandex Browser',
  'Coc Coc',
  'Iron',
  'Firefox Mobile',
  'Opera',
  'Mobile Safari',
  'UC Browser',
  'Chromium',
  'Vivaldi',
  'Chrome Mobile',
  'Dragon',
  'Android',
  'Mobile Safari UI/WKWebView',
  'Edge',
  'Safari',
  'IE',
  'Baiduspider',
  'Nokia OSS Browser',
  'Mail.ru Chromium Browser',
  'Chrome Mobile WebView',
  'Chrome Mobile iOS' ]

Why ?

Sometimes one might need up2date and real Useragents for different projects and need to spoof Useragent. This library is designed for that purphose. I will try to update this library frequently. The useragents.json is the value of this repository since this data will be kept recent. Imagine Mozilla releases new version, you would need to update all your libraries too with most recent version just to look legitime

Background

These useragents are from real webvisitors and are anonimized. A typical UA data looks like:

{
      "popularity": 53,
      "agent": {
        "family": "Chrome",
        "major": "69",
        "minor": "0",
        "patch": "3497",
        "device": {
          "family": "Other",
          "major": "0",
          "minor": "0",
          "patch": "0"
        },
        "os": {
          "family": "Windows",
          "major": "8",
          "minor": "0",
          "patch": "0"
        }
      },
      "popularityRate": 0.0007017353385310296
    }

The agent,os,device properties are prepared by using https://github.com/3rd-Eden/useragent library. popularity is the number of times we have seen this UA. In this example this UA was seen 53 times among whole logging-period and the popularityRate is the % amount from all other UserAgents

This data might grow during the time but mathematically this data should be equal to browser market share because it is taken from sites with a lot of traffic.

useragents's People

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.