Copying information from imdb

Asked

Viewed 561 times

0

Good morning to everyone , well I’m creating an application in PHP and I need to get information from Imdb movies ,What better way to capture information from Imdb? Curl or there’s some api I can help you with?

  • Have fun: http://www.imdb.com/interfaces

  • @Sorack thanks my friend

1 answer

1


You need to decode the response and assign it to variables (all in PHP).

<?php
$id = $_POST["id"];
$url = file_get_contents("http://www.omdbapi.com/?i=$id");
$json = json_decode($url, true); //This will convert it to an array
$movie_title = $json['Title'];
$movie_year = $json['Year'];
//and so on...

and then when you need to echo them:

echo $movie_title;

or

echo "The movie '$movie_title' was made in $movie_year.";

You can use this one too: PHP-IMDB-API is in json.

  • Guy was exactly what I was looking for, thank you very much

  • @Carlosdasilva I put a link to a project you have on github, take a look, maybe it will also help.

  • Ok, I have ordered the apikey that is necessary for the omdbapi to work, I am waiting for the msm

  • Because I will translate with PHP itself some things using a Google Translator library such as synopsis to soon after saving in the database

  • @Carlosdasilva in the imdbapi.class.php file can change the language, but only changes the genres.

  • is really a cool project, I can is using and making improvements in the project. I will see which best option.

Show 1 more comment

Browser other questions tagged

You are not signed in. Login or sign up in order to post.