2017 © Pedro Peláez
 

library fpl-api

Fantasy Premier League API

image

mlntn/fpl-api

Fantasy Premier League API

  • Tuesday, June 5, 2018
  • by mlntn
  • Repository
  • 5 Watchers
  • 8 Stars
  • 7 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 1 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

fantasy.premierleague.com API

Requires omni-cache, (*1)

Installation

Use composer:, (*2)

{
  "require": {
    "mlntn/fpl-api": "*",
    "mlntn/omni-cache": "*"
  },
  "minimum-stability": "dev",
  "repositories": [
    {
      "type": "git",
      "url": "https://github.com/mlntn/fpl-api"
    },
    {
      "type": "git",
      "url": "https://github.com/mlntn/omni-cache"
    }
  ]
}

Write a controller:, (*3)

<?php
$autoloader = require 'vendor/autoload.php';
$api = new Fpl\Api(new Cache\Provider\File('./cache', 86400));

$player = $api->getPlayer(323);
die(json_encode($player));

// prettier with this:
// json_encode($player, JSON_PRETTY_PRINT ^ JSON_UNESCAPED_UNICODE ^ JSON_UNESCAPED_SLASHES)

What does all that code above do?

The composer.json settings tell Composer to include this API and a caching tool I wrote called omni-cache., (*4)

The PHP controller sets up the autoloader, starts up a cache handler that caches to files for a maximum of 1 day, starts up the API class (passing in the cache handler) and grabs some player data (Artur Boruc) from fantasy.premierleague.com., (*5)

Check out Fpl\Api.php for other API methods., (*6)

The Versions

05/06 2018

dev-master

9999999-dev http://github.com/mlntn/fpl-api

Fantasy Premier League API

  Sources   Download

MIT

The Requires

 

by Jared Mellentine

07/07 2014

0.5.1

0.5.1.0 http://github.com/mlntn/fpl-api

Fantasy Premier League API

  Sources   Download

MIT

The Requires

 

by Jared Mellentine

15/03 2014

0.5.0

0.5.0.0 http://github.com/mlntn/fpl-api

Fantasy Premier League API

  Sources   Download

MIT

The Requires

 

by Jared Mellentine