Try 30 days of free premium.

Is my Coding up to date?

yesmovies wrote 6 years ago: 1

so my cronjobs quit working and I think all my cron.php is messed up. Can you please tell me if I have this all correct?

$omdb_json = file_get_contents('http://api.tvmaze.com/lookup/shows?imdb='.$imdb_id);

$imdb_data = json_decode($omdb_json);

$dat_tv_id = $imdb_data->id;

$omdb_json2 = file_get_contents('http://api.tvmaze.com/shows/'.$dat_tv_id.'/episodebynumber?season='.$season.'&number='.$episode);

$imdb_data2 = json_decode($omdb_json2);

$image_trakt = $imdb_data2->image->medium ;


gazza911 wrote 6 years ago: 1

That code works for me (make sure that you're using the full IMDb id; tt0944947 not 0944947).

Adding the following to the end outputs it to the browser (assuming you've set $imdb_id, $season & $episode to valid values of course)

$im = imagecreatefromjpeg($image_trakt);
header('Content-Type: image/jpeg');
imagejpeg($im);
imagedestroy($im);

Although you're not doing any validation to check that the API actually returns anything.

mero wrote 6 years ago: 1

TBH that is a very bad method to check if your cache is up to date. You're over doing a lot of stuff.

I suggest you store the TVmaze ID along the IMDB id. so you don't have to send repeated requests thus reducing your chances of hitting the request limit. Once you store the TVmaze ID you're ahead 2 extra steps.

Try 30 days of free premium.