rzwilliam / yu-gi-oh-scrapper
Yu gi oh monster cards scrapper
Requires
- php: >= 8.0
- ext-dom: *
- ext-libxml: *
- symfony/http-client: ^6.0.20
Requires (Dev)
- phpstan/phpstan: ^1.10
- phpunit/phpunit: ^9.6||^10.2
README
The Yu-Gi-Oh Card Scrapper is a PHP library that provides functions to retrieve information about Yu-Gi-Oh trading cards. It allows you to fetch a list of card names and retrieve the image of a specific card.
Installation
You can install the library using Composer. Run the following command in your project directory:
composer require rzwilliam/td3
Local
composer install
php vendor/bin/phpstan analyse src --level=max
php vendor/bin/phpunit tests
Usage
Retrieving a List of Card Names
To retrieve a list of all card names, use the GetAllCardsName function. This function accepts optional parameters to specify the start and end page numbers for fetching the cards. By default, it will retrieve cards from page 1 to page 143.
$api = new Api(); $cardNames = $api->GetAllCardsName();
Retrieving the Image of a Card
To retrieve the image of a specific card, use the GetCardImage function. Pass the name of the card as the parameter, and it will return an array with the card's name and image URL.
$api = new Api(); $cardName = 'Blue-Eyes White Dragon'; $cardDetails = $api->GetCardImage($cardName);