Ejemplo n.º 1
0
 /**
  * @covers ::getParser
  */
 public function testGetParser()
 {
     $handler = new UrlHandler();
     return $this->assertInstanceOf('hypeJunction\\Scraper\\Parser', $handler->getParser());
 }
Ejemplo n.º 2
0
Archivo: Embedder.php Proyecto: n8b/VMN
 /**
  * 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;
 }
Ejemplo n.º 3
0
Archivo: Parser.php Proyecto: n8b/VMN
 /**
  * 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;
 }
Ejemplo n.º 4
0
Archivo: Url.php Proyecto: n8b/VMN
 /**
  * Get URL page title
  * @return string
  */
 public function getQualifier()
 {
     $meta = $this->url->getMeta();
     return $meta->title ? $meta->title : $this->url->getUrl();
 }