PHP Classes

File: Demo/multipleDemo.php

Recommend this page to a friend!
  Classes of Ghali Ahmed   PHP Media Search Engine   Demo/multipleDemo.php   Download  
File: Demo/multipleDemo.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP Media Search Engine
Search multiple video sites for given keywords
Author: By
Last change:
Date: 9 years ago
Size: 1,019 bytes
 

Contents

Class file image Download
<?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);