tmdb api
This commit is contained in:
parent
cc3e39c598
commit
9a8d2dea0b
@ -3,9 +3,33 @@
|
||||
|
||||
class Movie
|
||||
{
|
||||
|
||||
private $apikey = "9fd90530b11447f5646f8e6fb4733fb4";
|
||||
private $baseurl = "https://api.themoviedb.org/3/";
|
||||
|
||||
|
||||
public function reindexMovies()
|
||||
{
|
||||
// todo search in folder for video files
|
||||
// todo reindex them and search in TheMovieDatabase for infos --> store them in DB
|
||||
|
||||
$dir = scandir("../data/");
|
||||
|
||||
foreach ($dir as $i) {
|
||||
echo "$i\n";
|
||||
if($i != "." && $i != ".."){
|
||||
$reply = json_decode(file_get_contents($this->baseurl . "search/movie?api_key=" . $this->apikey . "&query=" . $i));
|
||||
if($reply->total_results == 0){
|
||||
// no results found
|
||||
// todo maybe parse first pictures somehow
|
||||
}else{
|
||||
|
||||
}
|
||||
echo json_encode($reply);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$bla = new Movie();
|
||||
$bla->reindexMovies();
|
Loading…
Reference in New Issue
Block a user