コード例 #1
0
ファイル: TvShow.php プロジェクト: arsonik/imdb-client
 public function assignPageContent(\phpQueryObject $_)
 {
     parent::assignPageContent($_);
     $this->_seasons = [];
     foreach ($_['a[href^="/title/' . $this->_id . '/episodes?season="]'] as $seasonLink) {
         $this->_seasons[] = (int) pq($seasonLink)->text();
     }
 }
コード例 #2
0
ファイル: Episode.php プロジェクト: arsonik/imdb-client
 public function assignPageContent(\phpQueryObject $_)
 {
     parent::assignPageContent($_);
     preg_match('/Season (\\d+), Episode (\\d+)/', $_['h2.tv_header']->text(), $r);
     $this->_seasonNumber = $r[1];
     $this->_episodeNumber = $r[2];
     $this->_tvShowName = trim($_['h2.tv_header a']->text());
     preg_match('_/(tt[^/]+)/_', $_['h2.tv_header a']->attr('href'), $r);
     $this->_tvShowId = $r[1];
     $this->_datePublished = \DateTime::createFromFormat('(d M. Y)', $_['h1.header .nobr']->text());
 }