I have a few adjustments for alternate versions method
Sometimes there are still list items in the output, some of it is useful, most is not.
this filters out most of it.
I don't think it will be necessary to make a pull request for such small adjustments?
@tboothman maybe you can/will make this to a commit? at least if you think it is useful off course.
/**
* Get the Alternate Versions for a given movie
* @return array Alternate Version (array[0..n] of string)
* @see IMDB page /alternateversions
*/
public function alternateVersions()
{
if (empty($this->moviealternateversions)) {
$page = $this->getPage('AlternateVersions');
if (false !== strpos($page, 'id="no_content"')) {
return array();
}
$check = array("<ul><li>", "</li><li>");
if (preg_match_all('!<div class="soda (odd|even)">\s*(.*?)\s*</div>!ims', $page, $matches)) {
foreach ($matches[2] as $match) {
$alt = strip_tags(trim(str_replace("\n", " ", $match)), $check);
$this->moviealternateversions[] = $alt;
}
}
}
return $this->moviealternateversions;
}
I have a few adjustments for alternate versions method Sometimes there are still list items in the output, some of it is useful, most is not. this filters out most of it.
I don't think it will be necessary to make a pull request for such small adjustments? @tboothman maybe you can/will make this to a commit? at least if you think it is useful off course.