Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions src/Imdb/Title.php
Original file line number Diff line number Diff line change
Expand Up @@ -2950,14 +2950,20 @@ public function officialSites()
/** Get the complete keywords for the movie
* @return array keywords
* @see IMDB page /keywords
* @version Limited to 50 keywords
*/
public function keywords_all()
{
if (empty($this->all_keywords)) {
$page = $this->getPage("Keywords");
if (preg_match_all('|<a.*?href="/search/keyword[^>]+?>(.*?)</a>|', $page, $matches)) {
$this->all_keywords = $matches[1];
$query = <<<EOF
keyword {
text {
text
}
}
EOF;
$edges = $this->graphQlGetAll("TitleKeywordsPagination", "keywords", $query);
foreach ($edges as $edge) {
$this->all_keywords[] = $edge->node->keyword->text->text;
}
}
return $this->all_keywords;
Expand Down