Git Product home page Git Product logo

riot-api-datadragon's Introduction

RiotAPI PHP wrapper for DataDragon

Version v1.0.0

Build Status Test Coverage Packagist Packagist Support Project

Table of Contents

  1. Introduction
  2. Downloading
  3. DataDragon API

Welcome to the DataDragon PHP library repo! The goal of this library is to create easy-to-use library for anyone who might need one.

Here are some handy features:

  • Profile icon URL and HTML embed generating
  • Champion splash image URL and HTML embed generating
  • Champion loading image URL and HTML embed generating
  • Champion icon URL and HTML embed generating
  • Sprite image URL and HTML embed generating
  • Spell, passive, item and summoner spell icon URL and HTML embed generating
  • Runes reforged icon URL and HTML embed generating
  • Static resource (champions, spells, items, runes, ...) loading and processing

Please, refer mainly to the wiki pages. This file contains only general introduction to library features.

The easiest way to download and use this library is via Composer. If you are not using Composer yet, you should start right now!

While having Composer installed on your machine it takes only composer require "dolejska-daniel/riot-api-datadragon:^1" command to get the library ready to roll!

For additional information about downloading and initial setup, please see the wiki pages.

How easy is it to work with static images? For instance, to get loading screen art of Orianna?

Source:

echo DataDragonAPI::getChampionLoading('Orianna');
echo DataDragonAPI::getChampionLoading('Orianna', 7);

Output:

<img alt="Orianna" class="dd-icon dd-loading" src="https://ddragon.leagueoflegends.com/cdn/img/champion/loading/Orianna_0.jpg">
<img alt="Orianna" class="dd-icon dd-loading" src="https://ddragon.leagueoflegends.com/cdn/img/champion/loading/Orianna_7.jpg">

Render:

Orianna Dark Star Orianna

...a bit of nostalgia?

Source:

DataDragonAPI::iniByVersion('0.151.2');
echo DataDragonAPI::getItemIcon(3132);
echo DataDragonAPI::getItemIcon(3126);
echo DataDragonAPI::getItemIcon(3138);

Output:

<img alt="3132" class="dd-icon dd-item" src="https://ddragon.leagueoflegends.com/cdn/0.151.2/img/item/3132.png">
<img alt="3126" class="dd-icon dd-item" src="https://ddragon.leagueoflegends.com/cdn/0.151.2/img/item/3126.png">
<img alt="3138" class="dd-icon dd-item" src="https://ddragon.leagueoflegends.com/cdn/0.151.2/img/item/3138.png">

Render:

Heart of Gold Madred's Bloodrazor Leviathan

...or to display icon of champion and its spells based on its object from API?

Source:

// ...

$orianna = $api->getStaticChampion(61, true);
echo DataDragonAPI::getChampionSplashO($orianna);

foreach($orianna->spells as $spell)
    echo DataDragonAPI::getChampionSpellIconO($spell);

Output:

<img alt="Orianna" class="dd-icon dd-icon-champ" src="https://ddragon.leagueoflegends.com/cdn/8.24.1/img/champion/Orianna.png">

<img alt="OrianaIzunaCommand" class="dd-icon dd-spell" src="https://ddragon.leagueoflegends.com/cdn/8.24.1/img/spell/OrianaIzunaCommand.png">
<img alt="OrianaDissonanceCommand" class="dd-icon dd-spell" src="https://ddragon.leagueoflegends.com/cdn/8.24.1/img/spell/OrianaDissonanceCommand.png">
<img alt="OrianaRedactCommand" class="dd-icon dd-spell" src="https://ddragon.leagueoflegends.com/cdn/8.24.1/img/spell/OrianaRedactCommand.png">
<img alt="OrianaDetonateCommand" class="dd-icon dd-spell" src="https://ddragon.leagueoflegends.com/cdn/8.24.1/img/spell/OrianaDetonateCommand.png">

Render:

Orianna OrianaIzunaCommand OrianaDissonanceCommand OrianaRedactCommand OrianaDetonateCommand

For more, please see the wiki pages. More usage examples for DataDragonAPI can be found here.

Other Riot APIs

Library Description Latest Version Stable Version
All APIs (metapackage) GitHub Latest Release GitHub Release PHP Version
League of Legends API GitHub Latest Release GitHub Release PHP Version
Teamfight Tactics API GitHub Latest Release GitHub Release PHP Version
Legends of Runeterra API GitHub Latest Release GitHub Release PHP Version
Valorant API GitHub Latest Release GitHub Release PHP Version

riot-api-datadragon's People

Contributors

chypriote avatar dgunay avatar dolejska-daniel avatar elreco avatar florianmifsud avatar santutu avatar strebl avatar thekeymaster avatar

Stargazers

 avatar

Watchers

 avatar  avatar

riot-api-datadragon's Issues

Upgrade `psr/cache` to ^3

Is your feature request related to a problem? Please describe.
Trying to install this on a modern Laravel project, I had to downgrade psr/cache from ^3 to ^1.

Describe the solution you'd like
I'd like this package to upgrade psr/cache to ^3. I believe the changes would be minimal.

Describe alternatives you've considered
In the meantime, I'll downgrade psr/cache, hoping it won't cause other issues.

Thanks!

Dependency check symfony/cache and symfony/console

Is your feature request related to a problem? Please describe.
In Laravel 9, the dependence of symfony/console and symfony/cache increased to ^6.

Describe the solution you'd like
I think just need to add support for that version from the composer.json.

	"require": {
		"symfony/console": "^6|^5",
		"symfony/cache": "^6|^5",
	},

Describe alternatives you've considered
It would be nice to check if the symfony/console package is actually being used in the DataDragon library.
As far as I remember, version 4 provided the CLI.
If it is not used on the code and is unnecessary, you can consider deleting it.

Additional context
Add any other context or screenshots about the feature request here.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.