예제 #1
0
 /**
  * Retrieve information on a video via a remote API call
  *
  * Change the $remote_url parameters if id is not available, before passing off to the parent
  *
  * @return void
  */
 protected function get_remote_video_info()
 {
     if (empty($this->vid['id']) && !empty($this->vid['url'])) {
         $this->remote_url['pattern'] = str_replace('&video_id=%s', '&url=%s', $this->remote_url['pattern']);
         $this->remote_url['replace_key'] = 'url';
     }
     parent::get_remote_video_info();
 }
예제 #2
0
 /**
  * Retrieve information on a video via a remote API call
  *
  * @return void
  */
 protected function get_remote_video_info()
 {
     if (is_string($this->vid['url']) && $this->vid['url'] !== '') {
         // Temporarily change the url
         $real_url = $this->vid['url'];
         if (strpos($this->vid['url'], 'embedType=') !== false) {
             $this->vid['url'] = str_replace(array('embedType=api', 'embedType=iframe', 'embedType=popover', 'embedType=seo'), 'embedType=seo', $this->vid['url']);
             // avoid adding embedType twice
         } else {
             $this->vid['url'] = add_query_arg('embedType', 'seo', $this->vid['url']);
         }
         parent::get_remote_video_info();
         // Rest the url
         $this->vid['url'] = $real_url;
     }
 }
예제 #3
0
 /**
  * Retrieve information on a video via a remote API call
  */
 protected function get_remote_video_info()
 {
     if (empty($this->vid['id']) && !empty($this->vid['permalink'])) {
         $this->remote_url = $this->alternate_remote;
     }
     if (!empty($this->vid['subdomain'])) {
         $replace = '://' . $this->vid['subdomain'] . '.';
         $this->remote_url['pattern'] = str_replace('://videos.', $replace, $this->remote_url['pattern']);
     }
     parent::get_remote_video_info();
 }
예제 #4
0
 /**
  * Retrieve information on a video via a remote API call
  *
  * @uses WPSEO_Video_Details_Vzaar::$remote_url
  * @uses WPSEO_Video_Details_Vzaar::$base_url
  * @uses WPSEO_Video_Details_Vzaar::$alternate_remote_pattern
  *
  * @return void
  */
 protected function get_remote_video_info()
 {
     parent::get_remote_video_info();
     if (!isset($this->remote_response) && !empty($this->vid['id']) && !empty($this->base_url)) {
         $url = sprintf($this->alternate_remote_pattern, $this->base_url, $this->vid['id']);
         $url = $this->url_encode($url);
         $response = $this->remote_get($url, array('referer' => get_site_url()));
         if ($response !== false) {
             $this->remote_response = $response;
         }
     }
 }