Recommend this page to a friend! |
![]() |
Info | Documentation | ![]() |
![]() |
![]() |
Reputation | Support forum | Blog | Links |
Last Updated | Ratings | Unique User Downloads | Download Rankings | |||||
2024-07-18 (8 months ago) ![]() | Not enough user ratings | Total: 19 | All time: 11,370 This week: 47![]() |
Version | License | PHP version | Categories | |||
rand-ua 1.1.1 | MIT/X Consortium ... | 8.3.7 | HTTP, Testing, PHP 7 |
Description | Author | |
This class can generate browser user agent strings to test sites. Innovation Award
|
|
> Developed for PHP Classes Challenge!
> The _rand-ua_ project is a user-agent generator designed to provide random user-agent strings for various web browsers. This PHP library allows developers to easily generate random user-agent strings, which can be useful for web scraping, automated testing, and other applications that require varied user-agent headers.
<?php
// Composer autoloader.
require __DIR__ . '/vendor/autoload.php';
// Module namespace.
use Dant\RandUa\UserAgentGenerator;
// Get user-agent based on specified OS and Browser.
$specific_ua = UserAgentGenerator::create()->getUserAgent('Windows', 'edge');
// Get random user-agent.
$random_ua = UserAgentGenerator::create()->getRandomUserAgent();
// Possible output: Mozilla/5.0 (Windows NT 10.0) ...
| Operational System | Quantity | Ratio | Percentage | Command |
| ------------------- | ---------- | ----------- | ---------- | ---------------------------------------------------------------- |
| Windows | 1218 | 1218 / 2360 | 51,6% | UserAgentGenerator::create()->getUserAgent('Windows')
|
| Macintosh | 561 | 561 / 2360 | 23,7% | UserAgentGenerator::create()->getUserAgent('Macintosh')
|
| X11 (Unix) | 581 | 581 / 2360 | 24,6% | UserAgentGenerator::create()->getUserAgent('X11')
|
| Operational System | Quantity | Ratio | Percentage | Command |
| ------------------- | ---------- | --------- | ---------- | ------------------------------------------------------------------- |
| Windows | 284 | 284 / 600 | 47,3% | UserAgentGenerator::create()->getUserAgent('Windows', 'chrome')
|
| Macintosh | 122 | 122 / 600 | 20,3% | UserAgentGenerator::create()->getUserAgent('Macintosh', 'chrome')
|
| X11 (Unix) | 194 | 194 / 600 | 32,3% | UserAgentGenerator::create()->getUserAgent('X11', 'chrome')
|
| Operational System | Quantity | Ratio | Percentage | Command |
| ------------------- | ---------- | --------- | ---------- | ----------------------------------------------------------------- |
| Windows | 6 | 6 / 8 | 75% | UserAgentGenerator::create()->getUserAgent('Windows', 'edge')
|
| Macintosh | 1 | 1 / 8 | 12,5% | UserAgentGenerator::create()->getUserAgent('Macintosh', 'edge')
|
| X11 (Unix) | 1 | 1 / 8 | 12,5% | UserAgentGenerator::create()->getUserAgent('X11', 'edge')
|
| Operational System | Quantity | Ratio | Percentage | Command |
| ------------------- | ---------- | --------- | ---------- | --------------------------------------------------------------------|
| Windows | 329 | 329 / 589 | 55,8% | UserAgentGenerator::create()->getUserAgent('Windows', 'firefox')
|
| Macintosh | 25 | 25 / 589 | 4,2% | UserAgentGenerator::create()->getUserAgent('Macintosh', 'firefox')
|
| X11 (Unix) | 235 | 235 / 589 | 39,8% | UserAgentGenerator::create()->getUserAgent('X11', 'firefox')
|
| Operational System | Quantity | Ratio | Percentage | Command |
| ------------------- | ---------- | --------- | ---------- | ------------------------------------------------------------------ |
| Windows | 415 | 415 / 586 | 70,8% | UserAgentGenerator::create()->getUserAgent('Windows', 'opera')
|
| Macintosh | 23 | 23 / 586 | 3,9% | UserAgentGenerator::create()->getUserAgent('Macintosh', 'opera')
|
| X11 (Unix) | 148 | 148 / 586 | 25,2% | UserAgentGenerator::create()->getUserAgent('X11', 'opera')
|
| Operational System | Quantity | Ratio | Percentage | Command |
| ------------------- | ---------- | --------- | ---------- | ------------------------------------------------------------------- |
| Windows | 184 | 184 / 577 | 31,8% | UserAgentGenerator::create()->getUserAgent('Windows', 'safari')
|
| Macintosh | 390 | 390 / 577 | 67,5% | UserAgentGenerator::create()->getUserAgent('Macintosh', 'safari')
|
| X11 (Unix) | 3 | 3 / 577 | 0,5% | UserAgentGenerator::create()->getUserAgent('X11', 'safari')
|
# Create a fork from the original repository and clone it.
git clone https://github.com/dantsec/rand-ua.git
# Enter into the project folder.
cd rand-ua/
# Create a new branch with the name feat-[BRANCH_NAME].
git checkout -b feat-[BRANCH_NAME]
# Make your changes and commit them.
git add . && git commit -m "YOUR_COMMIT_MESSAGE"
# Push your branch and open a pull request.
git push origin feat-[BRANCH_NAME]
![]() |
File | Role | Description | ||
---|---|---|---|---|
![]() |
||||
![]() ![]() |
Data | Auxiliary data | ||
![]() ![]() |
Lic. | License text | ||
![]() ![]() |
Doc. | Read me |
The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page. |
![]() |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
100% |
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.