forked from romac/RRoEmbed
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.php
64 lines (48 loc) · 1.46 KB
/
test.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?php
// Include the autoloader.
require_once( dirname( __FILE__ ) . '/Classes/Autoloader.class.php' );
// Register the autoloader.
RRoEmbed_Autoloader::getInstance()->register();
// Create a new consumer.
$c = new RRoEmbed_Consumer();
// Call the "consume" method and supply it the URL of the resource you'd like
// to get the oEmbed representation of and the Provider instance.
//$o = $c->consume(
// 'http://www.flickr.com/photos/romac17/4101838222/',
// new RRoEmbed_Provider_Flickr( array() )
//);
//
//print $o;
try
{
$o = $c->consume(
'http://vimeo.com/15952335',
new RRoEmbed_Provider_Vimeo(
array( 'width' => 350, 'byline' => 'false', 'title' => 'false' )
)
);
print $o;
}
catch( RRoEmbed_Exception $e )
{
echo 'Error: ' . $e->getMessage() . ' in file: ' . substr( $e->getTraceAsString(), strrpos( $e->getTraceAsString(), '#', -10 ) );
}
// DailyMotion
//try
//{
// $o = $c->consume(
// 'http://www.dailymotion.com/video/xf02xp_uffie-difficult_music'
//// new RRoEmbed_Provider_Dailymotion()
// );
//
// print $o;
//}
//catch( RRoEmbed_Exception $e )
//{
// echo 'Error: ' . $e->getMessage() . ' in file: ' . substr( $e->getTraceAsString(), strrpos( $e->getTraceAsString(), '#', -10 ) );
//}
// Notice you can also omit to specify the provider, if so the Consumer will try to
// automatically find a valid provider endpoint.
//$o = $c->consume( 'http://vimeo.com/15952335' );
//
//print $o;