-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
53 lines (39 loc) · 1.92 KB
/
README
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
= Embedly for PHP
Embedly.php is a simple client for interfacing with the embed.ly API. (http://api.embed.ly)
== Usage
Instantiate the class by passing in the options, as supported by Embed.ly. At the very least, a
URL is required. Other (optional) parameters such as format, maxheight, maxwidth are supported
and can be passed into the second argument as an array.
$params = array(
'format' => 'json',
'maxwidth' => 250,
'maxheight' => '350',
);
$embedly = new Embedly('http://www.youtube.com/watch?v=60og9gwKh1o',$params);
Any parameters passed into Embedly.php will be sent over to Embed.ly.
To return something usable, you'll need to call the gets method. This processes the request, and will
return a JSON object.
print $embedly->getResponse();
Outputs the following object in the JSON format. (unless another format is specified)
{
"provider_url": "http://www.youtube.com/",
"description": "numa",
"title": "Numa Numa",
"url": "http://www.youtube.com/watch?v=60og9gwKh1o",
"type": "video",
"html": "<object width=\"640\" height=\"385\"><param name=\"movie\" value=\"http://www.youtube.com/v/60og9gwKh1o&fs=1\"><param name=\"allowFullScreen\" value=\"true\"><param name=\"allowscriptaccess\" value=\"always\"><embed src=\"http://www.youtube.com/v/60og9gwKh1o&fs=1\" type=\"application/x-shockwave-flash\" width=\"640\" height=\"385\" allowscriptaccess=\"always\" allowfullscreen=\"true\"></embed></object>",
"author_name": "xloserkidx",
"height": 385,
"width": 640,
"version": "1.0",
"thumbnail_width": 120,
"provider_name": "YouTube",
"thumbnail_url": "http://i.ytimg.com/vi/60og9gwKh1o/default.jpg",
"thumbnail_height": 90,
"author_url": "http://www.youtube.com/user/xloserkidx"
}
== PEAR Dependencies
Embedly for PHP depends on PEAR::HTTP_Request, which should be widely available
on most PHP system installations.
== Copyright
Copyright (c) 2010 Jason Hines ~ DevTwo, LLC. See LICENSE for details.