Esempio n. 1
0
 /**
  * inline {@inheritdoc}
  *
  * Im overriding this method because I need to set the
  * endpoint based on the given url. By default we're always assuming
  * it is a post url unless we have a specific video match.
  *
  * Why? Because we already did url validation and We dont want
  * to loop over both sets of patterns all over again right? So
  * we just need to loop over the smaller one ;)
  */
 public function getInfo()
 {
     $this->apiUrl = 'https://www.facebook.com/plugins/post/oembed.json/';
     if ($this->urlMatchesPattern($this->videoPatterns)) {
         $this->apiUrl = 'https://www.facebook.com/plugins/video/oembed.json/';
     }
     return parent::getInfo();
 }
Esempio n. 2
0
 /**
  * inline {@inheritdoc}
  *
  * Im overriding this method because the oembed endpoint
  * depends on the subdomain of the oembed response.
  */
 public function getInfo()
 {
     preg_match('~//([^ ]+)\\.didacte\\.com/a/course/~i', $this->url, $m);
     $this->apiUrl = str_replace('{m}', $m['1'], $this->apiUrl);
     return parent::getInfo();
 }