Skip to content

Commit 17d3016

Browse files
committed
Added tests/index.php for quick usage
1 parent 199c378 commit 17d3016

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

tests/index.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
3+
// Return data as json
4+
header('Content-Type: application/json');
5+
6+
// Import libs
7+
require "../vendor/autoload.php";
8+
use PHPHtmlParser\Dom;
9+
use hmerritt\Imdb\Imdb;
10+
11+
12+
// Get url search param
13+
$q = $_GET["q"];
14+
15+
// Initialise Imdb
16+
// Load film data
17+
$imdb = new Imdb();
18+
$film = $imdb->film($q, $techSpecs=true); // tt0816692 tt8633464
19+
20+
// Return loaded film data
21+
echo json_encode($film, JSON_PRETTY_PRINT);

0 commit comments

Comments
 (0)