Closed Thomasdouscha closed 2 years ago
The function you are looking for got the name real_id()
.
I found it in source files. But as i understood this is for ttxxxxxxx of movie page. I need that similar function for nmxxxxxxx of person page. Or is there any way as alternative?
Sorry about that, I read it wrong. There aren't one for persons.
Just checked on how it works. You specify that you want nm8484559, and after the redirect (imdbphp handles it automatically). You need to check real_id()
and see if it matches the one you wanted. And that way you know if it have been changed. There are no way of getting the previous id.
The same data are available on nm pages.
<meta property="pageId" content="nm2092886" />
Do you suggest me that i will check the code of real_id() of title cards and I use this way and code real_id() of person cards? interesting :) Ok i ll try it. But in my opinion imdbphp should have real_id() of person pages. Am i wrong? I wanna notice that i used your imdbphp on my website. It is really very useful. Thanks for that. And secondly you have swedish name surname, maybe it is nickname. I dont know. I was born in sweden and after 5 years old my family moved to Turkey / istanbul. My Mother is swedish from goteborg. Thatswhy name & surname was interesting. Thanks for replies and suggestion.
In Class Person of Person.php i added codes: public function real_id() { $page = $this->getPage('Name'); if (preg_match('#<meta property="pageId" content="nm(\d+)"#', $page, $matches) && !empty($matches[1])) { return $matches[1]; } } Result is in my database for example which i wrote in my first message:
As you see imdb_id is not equal to real_id so it works perfectly. I suggest that this code should be added in person.php
And my suggestion?
I don't know anything about github. I ll check the links.
public function real_id()
{
$page = $this->getPage('Name');
if (preg_match('#<meta property="pageId" content="nm(\d+)"#', $page, $matches) && !empty($matches[1])) {
return $matches[1];
}
}
This code works. May be somebody can pull request it. I don't know how to do.
for example: when enter this url : https://www.imdb.com/name/nm8484559/ redirect to: https://www.imdb.com/name/nm2092886/
For this reason is there any function for getting real_id?