A PHP library to scrape Valorant agent data from mandatory.gg and expose it as PHP objects.

1.2.0 2023-07-04 12:02 UTC

This package is auto-updated.

Last update: 2024-05-04 13:51:28 UTC


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