Skip to content

Commit

Permalink
Full commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Valdeci Jr committed Aug 10, 2017
1 parent 533562d commit cb2ac5c
Show file tree
Hide file tree
Showing 15 changed files with 910 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/vendor/
26 changes: 24 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,24 @@
# samba-videos-api
PHP library for the Samba Videos API. http://dev.sambatech.com/documentation/sambavideos/index.html
# Samba Videos API

PHP library for Samba Videos API. http://dev.sambatech.com/documentation/sambavideos/index.html


## Requirements

- PHP >= 5.6
- ext-curl
- ext-json
- [Unirest for PHP](https://github.com/Mashape/unirest-php)
- [Monolog - Logging for PHP](https://github.com/Seldaek/monolog)


## Installation

```bash
composer require izapbrasil/samba-videos-api
```


## Contributors

To see the contributors please visit the [contributors graph](https://github.com/izapbrasil/samba-videos-api/graphs/contributors).
32 changes: 32 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"name": "izapbrasil/samba-videos-api",
"description": "PHP library for Samba Videos API.",
"type": "library",
"homepage": "https://github.com/izapbrasil/samba-videos-api",
"keywords": ["sambatech", "sambavideos", "samba-videos"],
"license": "Apache-2.0",
"authors": [
{
"name": "iZap",
"homepage": "https://izap.com.br"
},
{
"name": "Valdeci Jr",
"email": "[email protected]"
}
],
"minimum-stability": "stable",
"require": {
"php": ">=5.6.0",
"ext-curl": "*",
"ext-json": "*",

"mashape/unirest-php": "^3.0",
"monolog/monolog": "^1.23"
},
"autoload": {
"psr-4": {
"SambaVideos\\": "src/SambaVideos"
}
}
}
193 changes: 193 additions & 0 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 40 additions & 0 deletions example/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?php
/*
* Copyright 2017 iZap
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
require_once '../vendor/autoload.php';

$access_token = 'ACCESS-TOKEN';

try {
// Projects
$project = \SambaVideos\Resource\Project::instance($access_token);
$projects = $project->search();
$project_id = $projects[0]['id'];
var_dump($projects);

// Categories
$category = \SambaVideos\Resource\Category::instance($access_token);
$categories = $category->search(['pid' => $project_id]);
var_dump($categories);

// Medias
$media = \SambaVideos\Resource\Media::instance($access_token);
$medias = $media->search(['pid' => $project_id]);
var_dump($medias);
} catch (Exception $e) {
var_dump($e);
}

Loading

0 comments on commit cb2ac5c

Please sign in to comment.