Skip to content

Commit

Permalink
Initial commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaideepghosh committed Jun 19, 2018
0 parents commit cd5e69e
Show file tree
Hide file tree
Showing 5 changed files with 487 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/vendor/
/accesstoken.txt
/composer.lock
89 changes: 89 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# php-football library for Roanuz Football API
php-football library for using Roanuz Football API in any website or web-app written in php. Easy to install and simple way to access all Roanuz Football API. Its a Php library for showing Live Football Score, Football Match Schedule and Statistics.

## Get Started
1. A) Clone the php-football Github project by using `https://github.com/roanuz/php-football.git`
<p align="center">
(Or)
</p>
B) Install the php-football using Composer. Follow the below instructions.

i) Download and install Composer by following the [official instructions.](https://getcomposer.org/download/)
ii) Create a composer.json defining your dependencies inside your project root directory.
```rust
// Copy this content into your composer.json file.

{
"repositories": [
{
"url": "https://github.com/roanuz/php-football.git",
"type": "git"
}
],
"minimum-stability" : "dev",
"prefer-stable" : true,
"require-dev": {
"roanuz/php-football": "dev-master"
}
}
```

iii) Run Composer: `composer require --dev roanuz/php-football`

iv) You can find the php-football library`(roanuz/php-football)` inside the vendor folder.


2. Create a Football API APP here [My APP Login](https://www.footballapi.com/)

3. Pass the required app credentials as below.

## Config Section
```rust
// Create a new php file under your root directory. Inside that use this code.

require_once __DIR__ . '/vendor/autoload.php';

$phpFootball = new PhpFootball\PhpFootballLib('YOUR_ACCESS_KEY', 'YOUR_SECRET_KEY', 'YOUR_APP_ID', 'UNIQUE_DEVICE_ID');

```
4. After Completing Authentication you can successfully access the API's.

## Example
```rust

// For getting particular match details.
$getMatch = $phpFootball->getMatch('MATCH_KEY');
echo json_encode($getMatch);//Return Match Information in JSON format

// For getting schedule details
$getSchedule = $phpFootball->getSchedule('2018-05'); //To get the schedules of month May, 2018.
echo json_encode($getSchedule); // Return Schedule Information in JSON format
```

To get the Live Score updates, you need to purchase the plan on [FootballAPI Website](https://www.footballapi.com/)

### Need More Code reference ?

Dive in to this file. [Example Code to Access Roanuz Football API](https://github.com/roanuz/php-football/blob/master/example.php)

### Here is List of Roanuz Football API's

* [Match API](https://www.footballapi.com/)
* [Tournament API](https://www.footballapi.com/)
* [Tournament Team API](https://www.footballapi.com/)
* [Tournament Round API](https://www.footballapi.com/)
* [Tournament Stats API](https://www.footballapi.com/)
* [Tournament Team Stats API](https://www.footballapi.com/)
* [Tournament Player Stats API](https://www.footballapi.com/)
* [Schedule API](https://www.footballapi.com/)
* [Tournament Schedule API](https://www.footballapi.com/)
* [Recent Tournaments API](https://www.footballapi.com/)
* [Round Matches API](https://www.footballapi.com/)
* [Recent Tournament Matches API](https://www.footballapi.com/)
* [Tournament Standings API](https://www.footballapi.com/)

## Roanuz Football API
This Library uses the Roanuz Football API for fetching football scores and stats. Feel free to contact their amazing support team, if you fave any query or doubt.

### Support
If you any question, feel free to contact us at - support@cricketapi.com
29 changes: 29 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "roanuz/php-football",
"description": "This is php-football library to show Live Football Scores.",
"authors": [
{
"name": "Roanuz Football API",
"homepage": "https://www.footballapi.com/"
}
],
"support": {
"email": "support@cricketapi.com"
},
"minimum-stability": "dev",
"require": {
"php": ">=5.3.0"
},
"autoload": {
"psr-0": {
"PhpFootball": "src/"
}
},
"license": "Apache-2.0",
"repositories": [
{
"url": "https://github.com/roanuz/php-football.git",
"type": "git"
}
]
}
62 changes: 62 additions & 0 deletions example.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<?php
require_once __DIR__ . '/vendor/autoload.php'; // Autoload files using Composer autoload
$phpFootball = new PhpFootball\PhpFootballLib('YOUR_ACCESS_KEY', 'YOUR_SECRET_KEY', 'YOUR_APP_ID', 'UNIQUE_DEVICE_ID');

/**
* NOTE: To access the Roanuz Football API's data, you need Valid Match Keys.
*
* Here, you may try with some Free Match Keys.
*
*/
/* Get Match Details */
// $getMatch = $phpFootball->getMatch('1002227292686127105');
// echo json_encode($getMatch);

/* Get Tournament Details */
// $getTournament = $phpFootball->getTournament('1002227289901109249');
// echo json_encode($getTournament);

/* Get Tournament Team Details */
// $getTournamentTeam = $phpFootball->getTournamentTeam('1002227289901109249','1002227289360044045');
// echo json_encode($getTournamentTeam);

/* Get Tournament Round Details */
// $getTournamentRound = $phpFootball->getTournamentRound('1002227289901109249','1002227290739970049');
// echo json_encode($getTournamentRound);

/* Get Tournament Stats Details */
// $getTournamentStats = $phpFootball->getTournamentStats('1002227289901109249');
// echo json_encode($getTournamentStats);

/* Get Tournament Team Stats Details */
// $getTournamentTeamStats = $phpFootball->getTournamentTeamStats('1002227289901109249','1002227289360044045');
// echo json_encode($getTournamentTeamStats);

/* Get Tournament Player Stats Details */
// $getTournamentPlayerStats = $phpFootball->getTournamentPlayerStats('1002227289901109249','1003604635140886535');
// echo json_encode($getTournamentPlayerStats);

/* Get Schedule */
// $getSchedule = $phpFootball->getSchedule();
// $getSchedule = $phpFootball->getSchedule('2018-05');
// echo json_encode($getSchedule);

/* Get Tournament Schedule */
// $getTournamentSchedule = $phpFootball->getTournamentSchedule('1002227289901109249');
// echo json_encode($getTournamentSchedule);

/* Get Recent Schedule */
// $getRecentTournament = $phpFootball->getRecentTournament();
// echo json_encode($getRecentTournament);

/* Get Matches in Round */
// $getTournamentMatches = $phpFootball->getTournamentMatches('1002227289901109249','1002227290739970049');
// echo json_encode($getTournamentMatches);

/* Get Matches in Round */
// $getRecentTournamentMatches = $phpFootball->getRecentTournamentMatches('1002227289901109249');
// echo json_encode($getRecentTournamentMatches);

/* Get Tournament Standings */
// $getTournamentStandings = $phpFootball->getTournamentStandings('1002227289901109249');
// echo json_encode($getTournamentStandings);
Loading

0 comments on commit cd5e69e

Please sign in to comment.