/** * @covers ::getParser */ public function testGetParser() { $handler = new UrlHandler(); return $this->assertInstanceOf('hypeJunction\\Scraper\\Parser', $handler->getParser()); }
/** * Prepare view/hook params * * @param array $params Params to pass by default * @return array */ public function prepareParams(array $params = array()) { $embed_params = array_filter(array('src' => $this->url->getURL(), 'entity' => $this->getEntity(), 'meta' => $this->getMeta())); $params = array_merge($params, $embed_params); return $params; }
/** * Parse JSON from the URL * * @param string $endpoint Endpoint * @param boolean $as_array Decode as array * @return boolean */ protected function parseJson($endpoint = '', $as_array = true) { $handler = new UrlHandler($endpoint); $json = $handler->getContent($endpoint); if ($json) { return json_decode($json, $as_array); } return false; }
/** * Get URL page title * @return string */ public function getQualifier() { $meta = $this->url->getMeta(); return $meta->title ? $meta->title : $this->url->getUrl(); }