quentindrouet / rendu1
A PHP library to scrape Valorant agent data from mandatory.gg and expose it as PHP objects.
Requires
- php: >=8.0
- symfony/css-selector: ^6.0||6.3
- symfony/dom-crawler: ^6.0||^6.3
- symfony/http-client: ^6.0||^6.3
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.20
- phpstan/phpstan: ^1.10
- phpunit/phpunit: ^9.6 || ^10.2
README
Valorant Agent Scraper is a PHP library that allows you to scrape data about agents from the game Valorant, available on the website mandatory.gg. This library fetches the agent's name and biography and represents it in a PHP object.
Requirements
- PHP >= 8.0
- Composer
Installation
composer require quentindrouet/rendu1
Usage
Here is an example that shows how you can use Valorant Agent Scraper to scrape data about agents from the website:
<?php require_once 'vendor/autoload.php'; use Quentindrouet\Rendu1\ValorantAgentScraper; // Create a new scraper instance $scraper = new ValorantAgentScraper(); // Scrape the agents $agents = $scraper->scrapeAgents(); // Output the scraped data foreach ($agents as $agent) { echo "Name: " . $agent['name'] . "\n"; echo "Biography: " . $agent['biography'] . "\n\n"; }
Testing
This library includes unit tests. To run the tests, first, make sure you have installed the dependencies with Composer, then run:
php vendor/bin/phpunit tests
Code Analysis
The library utilizes PHPStan for code analysis. To execute PHPStan, run:
php vendor/bin/phpstan analyse src tests --level max
Contributing
Contributions are welcome. Please make sure that your code follows the PSR-12 coding standard. You can use the PHP CS Fixer to check and fix coding standards:
php vendor/bin/php-cs-fixer fix src --rules=@PSR12 php vendor/bin/php-cs-fixer fix tests --rules=@PSR12
License
Valorant Agent Scraper is licensed under the MIT License