/** * @param $htmlResponse */ public function __construct($htmlResponse) { parent::__construct($htmlResponse); $html = $this->getHtmlResponse(); phpQuery::newDocumentHTML($html); $tableRows = pq('.rowEven,.rowOdd'); foreach ($tableRows as $tableRow) { $tableRow = pq($tableRow)->remove('.spacer'); $departureObject = new \stdClass(); $departureObject->lineNumber = trim(pq($tableRow)->find('.lineColumn')->html()); $departureObject->destination = trim(preg_replace("(<([a-z]+).*?>.*?</\\1>)is", "", pq($tableRow)->find('.stationColumn')->html())); $departureObject->time = trim(pq($tableRow)->find('.inMinColumn')->html()); $this->departureObjects[] = $departureObject; } //Time + Station name $this->setStation(pq('.headerStationColumn')->html()); $this->setCurrentTime(pq('.serverTimeColumn')->html()); }
/** * @param $response */ public function __construct($response) { parent::__construct($response); $this->parse(); }