Recommend this page to a friend! |
Download |
Info | Example | Files | Install with Composer | Download | Reputation | Support forum | Blog | Links |
Ratings | Unique User Downloads | Download Rankings | ||||
62% | Total: 344 | All time: 7,052 This week: 56 |
Version | License | PHP version | Categories | |||
awesomemedia 1.0.0 | The PHP License | 5.3 | PHP 5, Searching, Web services, Audio, V... |
Description | Author | |||
This package can search multiple video, audio and picture sites for given keywords. Innovation Award
|
<?php |
Extensible MediaProvider management script that can query several provider such as Youtube/dailymotion/vimeo and return a list of normalized results.
Add the AwesomeMedia library to your composer.json file's require field
{
"require" : {
"ghaliano/AwesomeMedia" : "dev-master"
}
}
This is a typical configuration used on the demo https://github.com/ghaliano/awesome-media/blob/master/Demo/config.php
<?php
$youtubeConfig = [
'developer_key' => null
];
$dailymotionConfig = [
'api_key' => null,
'secret_key'=> null
];
$vimeoConfig = [
'api_key' => null,
'secret_key'=> null,
'access_token' => null
];
$soundcloudConfig = [
'api_key' => '',
'secret_key' => '',
'login' => '',
'password' => ''
];
<?php
$loader = require '../vendor/autoload.php';
require 'config_dev.php';
use MediaGateway\ProviderClientFactory;
use MediaGateway\Provider\YoutubeProvider;
$youtubeProvider = new YoutubeProvider(
ProviderClientFactory::create('youtube', $youtubeConfig)
);
$query = new \MediaGateway\Query();
$query->setTerm('kittens')->setLimit(10);
$result = $youtubeProvider->search($query);
print '<pre>';
print_r($result);
The component use a Chain class to manipulate mutiple providers like one
<?php
$loader = require '../vendor/autoload.php';
require 'config_dev.php';
use MediaGateway\Provider\ProviderChain;
use MediaGateway\ProviderClientFactory;
use MediaGateway\Provider\YoutubeProvider;
use MediaGateway\Provider\VimeoProvider;
use MediaGateway\Provider\DailymotionProvider;
use MediaGateway\Provider\SoundcloudProvider;
use MediaGateway\Provider\FlickrProvider;
$providerChain = new ProviderChain();
$providerChain->addProviders([
new YoutubeProvider(new MediaGateway\Client\YoutubeClient($youtubeConfig)),
new VimeoProvider(new MediaGateway\Client\VimeoClient($vimeoConfig)),
new DailymotionProvider(new MediaGateway\Client\DailymotionClient($dailymotionConfig)),
new SoundcloudProvider(new MediaGateway\Client\SoundcloudClient($soundcloudConfig)),
new FlickrProvider(new MediaGateway\Client\FlickrClient($flickerConfig))
]);
$query = new \MediaGateway\Query();
$query->setTerm('kittens')->setLimit(10);
$result = $providerChain->search($query);
print '<pre>';
print_r($result);
https://github.com/ghaliano/awesome-media/blob/master/Demo/demo.php
Files (36) |
File | Role | Description | ||
---|---|---|---|---|
Demo (3 files) | ||||
MediaGateway (1 directory) | ||||
composer.json | Data | Auxiliary data | ||
composer.lock | Data | Auxiliary data | ||
README.md | Doc. | Auxiliary data |
Files (36) | / | Demo |
File | Role | Description |
---|---|---|
config.php | Conf. | Configuration script |
demo.php | Example | Example script |
multipleDemo.php | Example | Example script |
Files (36) | / | MediaGateway | / | src | / | MediaGateway |
File | Role | Description | ||
---|---|---|---|---|
Client (6 files) | ||||
Model (6 files) | ||||
Normalizer (5 files) | ||||
Provider (7 files) | ||||
MediaItemNormalizerInterface.php | Class | Class source | ||
MediaProviderAuthenticationException.php | Class | Class source | ||
MediaProviderClientInterface.php | Class | Class source | ||
MediaProviderException.php | Class | Class source | ||
MediaProviderInterface.php | Class | Class source | ||
Query.php | Class | Class source |
Files (36) | / | MediaGateway | / | src | / | MediaGateway | / | Client |
File | Role | Description |
---|---|---|
DailymotionClient.php | Class | Class source |
FlickrClient.php | Class | Class source |
MediaProviderClient.php | Class | Class source |
SoundcloudClient.php | Class | Class source |
VimeoClient.php | Class | Class source |
YoutubeClient.php | Class | Class source |
Files (36) | / | MediaGateway | / | src | / | MediaGateway | / | Model |
File | Role | Description |
---|---|---|
Dailymotion.php | Class | Class source |
Flickr.php | Class | Class source |
MediaProvider.php | Class | Class source |
Soundcloud.php | Class | Class source |
Vimeo.php | Class | Class source |
Youtube.php | Class | Class source |
Files (36) | / | MediaGateway | / | src | / | MediaGateway | / | Normalizer |
File | Role | Description |
---|---|---|
DailymotionNormalizer.php | Class | Class source |
FlickrNormalizer.php | Class | Class source |
SoundcloudNormalizer.php | Class | Class source |
VimeoNormalizer.php | Class | Class source |
YoutubeNormalizer.php | Class | Class source |
Files (36) | / | MediaGateway | / | src | / | MediaGateway | / | Provider |
File | Role | Description |
---|---|---|
AbstractProvider.php | Class | Class source |
DailymotionProvider.php | Class | Class source |
FlickrProvider.php | Class | Class source |
ProviderChain.php | Class | Class source |
SoundcloudProvider.php | Class | Class source |
VimeoProvider.php | Class | Class source |
YoutubeProvider.php | Class | Class source |
The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page. |
Install with Composer |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
100% |
|
|
User Ratings | ||||||||||||||||||||||||||||||
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.