rzwilliam/yu-gi-oh-scrapper

Yu gi oh monster cards scrapper

1.0.0 2023-07-03 21:41 UTC

This package is auto-updated.

Last update: 2024-12-04 00:52:14 UTC


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);