-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathsample.php
More file actions
29 lines (21 loc) · 745 Bytes
/
sample.php
File metadata and controls
29 lines (21 loc) · 745 Bytes
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
<?php
include 'omdb.class.php';
try {
//Init OMDb and include data from Rotten Tomatoes
$omdb = new OMDb( ['tomatoes' => TRUE, 'apikey' => '00000000'] );
//Get by title
$movie = $omdb->get_by_title('Pulp Fiction');
//Get by IMDb id
$movie = $omdb->get_by_id('tt0057012');
//Get episodes by IMDb id and season number (1)
$movie = $omdb->get_by_id('tt2085059', 1);
//Get episode 2 by IMDB id and season number (1)
$movie = $omdb->get_by_id('tt2085059', 1, 2);
//Get multiple titles, limited info see the README
$movie = $omdb->search('James Bond');
//Get multiple titles with pagination
$movie = $omdb->search('James Bond', 2);
}catch(Exception $e) {
echo $e->getMessage();
}
?>