GithubHelp home page GithubHelp logo

ravorrprime / riot-api-datadragon Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dolejska-daniel/riot-api-datadragon

0.0 0.0 0.0 3.93 MB

License: GNU General Public License v3.0

PHP 100.00%

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

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.