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