-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Populate readme with examples and basic description.
- Loading branch information
Showing
1 changed file
with
30 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,32 @@ | ||
traktor | ||
Traktor | ||
======= | ||
|
||
A Trakt.tv API client library in PHP, compatible with PSR-4 and Composer. | ||
[![Build Status - Master](https://api.travis-ci.org/alanly/traktor.svg?branch=master)](https://travis-ci.org/alanly/traktor) | ||
|
||
Traktor is a simple PHP client for the Trakt.tv API service, that allows you to cleanly integrate the data available on Trakt into your application. Currently, it supports only non-developer and GET-based methods. | ||
|
||
It aims to be fairly basic and simple to use: | ||
|
||
```php | ||
$traktor = new Traktor\Client; | ||
$traktor->setApiKey('foobar'); | ||
$summary = $traktor->get('movie.summary', ['the-social-network-2010']); | ||
echo $summary->imdb_id; | ||
// "tt1285016" | ||
echo $summary->tagline; | ||
// "You don't get to 500 million friends without making a few enemies" | ||
``` | ||
|
||
```php | ||
$traktor = new Traktor\Client; | ||
$traktor->setApiKey('foobar'); | ||
$summary = $traktor->get('show.episode.summary', ['silicon-valley', 1, 3]); | ||
echo $summary->show->title; | ||
// "Silicon Valley" | ||
echo $summary->episode->season; | ||
// 1 | ||
echo $summary->episode->number; | ||
// 3 | ||
echo $summary->episode->title; | ||
// "Articles of Incorporation" | ||
``` |