Esempio n. 1
0
 public function latest()
 {
     $token = new \Tmdb\ApiToken('API_KEY');
     $client = new \Tmdb\Client($token, ['secure' => false]);
     $popularity = $client->getDiscoverApi()->discoverMovies(['page' => 1, 'language' => 'fr', 'sort_by' => 'popularity.desc', 'release_date.gte' => '2015-01-01']);
     $vote = $client->getDiscoverApi()->discoverMovies(['page' => 1, 'language' => 'fr', 'sort_by' => 'vote_count.desc']);
     $cinema = $client->getDiscoverApi()->discoverMovies(['page' => 1, 'language' => 'fr', 'primary_release_date.gte' => '2015-12-15', 'primary_release_date.lte' => '2016-02-01']);
     return view('pages/home', ['popularity' => $popularity, 'vote' => $vote, 'cinema' => $cinema]);
 }
Esempio n. 2
0
 public function show($id)
 {
     $token = new \Tmdb\ApiToken('API_KEY');
     $client = new \Tmdb\Client($token, ['secure' => false]);
     $movie = $client->getMoviesApi()->getMovie($id, array('language' => 'fr'));
     $credits = $client->getMoviesApi()->getCredits($id);
     $images = $client->getMoviesApi()->getImages($id);
     $response = $client->getDiscoverApi()->discoverMovies(['page' => 1, 'language' => 'fr']);
     $trailers = $client->getMoviesApi()->getTrailers($id);
     return view('pages/movie', ['movie' => $movie, 'credits' => $credits, 'images' => $images, 'response' => $response, 'trailers' => $trailers]);
 }
Esempio n. 3
0
 public function showTrois($tag)
 {
     $ids = session('ids');
     $idss = session('ids');
     $idss .= '|' . $tag . '|' . $ids;
     session(['ids' => $idss]);
     $token = new \Tmdb\ApiToken('API_KEY');
     $client = new \Tmdb\Client($token, ['secure' => false]);
     $questions = Question::orderByRaw('RAND()')->take(1)->get();
     $response = $client->getDiscoverApi()->discoverMovies(['page' => 1, 'language' => 'fr', 'with_keywords' => $idss]);
     return view('pages/question4', ['response' => $response, 'questions' => $questions]);
 }
Esempio n. 4
0
File: tv.php Progetto: n10ty/api
<?php

/**
 * This file is part of the Tmdb PHP API created by Michael Roterman.
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 *
 * @package Tmdb
 * @author Michael Roterman <*****@*****.**>
 * @copyright (c) 2013, Michael Roterman
 * @version 0.0.1
 */
require_once '../../../vendor/autoload.php';
require_once '../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
$response = $client->getDiscoverApi()->discoverTv(array('page' => 1, 'language' => 'en'));
var_dump($response);
Esempio n. 5
0
<?php

/**
 * This file is part of the Tmdb PHP API created by Michael Roterman.
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 *
 * @package Tmdb
 * @author Michael Roterman <*****@*****.**>
 * @copyright (c) 2013, Michael Roterman
 * @version 0.0.1
 */
require_once '../../../vendor/autoload.php';
require_once '../../../apikey.php';
$token = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);
$response = $client->getDiscoverApi()->discoverMovies(['page' => 1, 'language' => 'en']);
var_dump($response);