hmerritt / php-imdb-api

PHP IMDB-API that can fetch film data and search results
Apache License 2.0
59 stars 22 forks source link

Year info is wrong #18

Closed xoex closed 1 year ago

xoex commented 1 year ago

Hi. There's an error in api that show the year of the movie in a wrong way:

'year' => string 'Cast & crew'

hmerritt commented 1 year ago

Thank you for pointing this out -> fixing it now :)

xoex commented 1 year ago

By the way, Why bother when you can decode json data in page instead of scraping content? something like this works nice : $script = $dom->find("script[type=\"application/ld+json\"]", 0); $json = json_decode($script->innertext);

note that $dom is parsed dom from page. but with finding script and decode the inside json, you could have all the data you need.

hmerritt commented 1 year ago

I noticed that JSON while fixing this -> initially got excited but it doesn't have all the data I need.

I might use it anyway and then merge with the existing method (since it's probably more reliable)

hmerritt commented 1 year ago

Anyhow, I've fixed this issue in version v1.2.8