Generate Random User Agents With Rotation.js

Category: Javascript | June 16, 2024
Author:creuserr
Views Total:12 views
Official Page:Go to website
Last Update:June 16, 2024
License:MIT

Preview:

Generate Random User Agents With Rotation.js

Description:

Rotation.js is a lightweight JavaScript random user-agent generator that allows developers to generate random user agents for various devices, browsers, and bots.

Web developers and testers can use rotation.js to simulate different user environments and ensure their applications work consistently across different devices and browsers. This library can also be useful for web scraping, where you may need to rotate user agents to avoid detection or IP blocking. Furthermore, it can be helpful for security researchers and penetration testers who need to mimic different user agents for their testing scenarios.

Supported User Agents:

  • Baidu Spider
  • Bing Bot
  • Google Bot
  • PlayStation
  • Xbox One
  • Nintendo
  • Chrome OS
  • Windows
  • Mac
  • iPhone
  • MS Lumia
  • Samsung
  • Google Pixel
  • Motorola
  • Android
  • Edge
  • Firefox
  • Opera
  • Chrome
  • Kindle Fire
  • iPad
  • Apple Watch
  • Apple TV

How to use it:

1. Download and include the rotation.js library on your webpage.

<script src="/dist/rotation.min.js"></script>

2. To generate a random user agent for a specific device, browser, or bot, you can use the following functions:

createBaiduSpider()
createBingBot()
createGoogleBot()
createNintendo()
createPlayStation()
createXboxOne()
createIphone()
createIpad()
createAppleWatch()
createAppleTV()
createMSLumia()
createChromeOS()
createMacSafari()
createAmazonKindle()
createSamsung()
createGooglePixel()
createMotorola()
createAndroid()
createAndroidEdge()
createAndroidFirefox()
createAndroidOperaMini()
createAndroidChrome()
createAndroidOpera()
/* {
     "type": "android",
     "useragent": "Mozilla/5.0 (Linux; Android 12; IWJ1007 Build/XF8560) AppleWebKit/358.502 (KHTML, like Gecko) Version/3.0 Chrome/1779 Mobile Safari/74"
   }
/*
Rotation.createAndroid()

3. Alternatively, you can generate fully random user agents using these functions:

randomMobile()
randomAndroid()
randomAndroidBrowser()
randomDesktop()
randomApple()
randomConsole()
randomBot()
random()
/* {
     "type": "chromeos",
     "useragent": "Mozilla/5.0 (X11; CrOS x32 440.836) AppleWebKit/468.701 (KHTML, like Gecko) Chrome/5317 Safari/656.23"
   }
/*
Rotation.random()

Changelog:

2024-06-16

  • Update rotation.js

You Might Be Interested In:


Leave a Reply