Ejemplo n.º 1
0
 /**
  * @param Crawler $crawler
  * @return ExtractedOwner
  */
 public function extractOwner(Crawler $crawler)
 {
     $owner = new ExtractedOwner();
     $owner->setName(trim(implode("", $crawler->filter(".yt-user-info")->extract(array('_text')))));
     $owner->setAvatarByUrl(trim(implode("", $crawler->filter(".yt-thumb-clip img")->extract(array('data-thumb')))));
     return $owner;
 }
Ejemplo n.º 2
0
 /**
  * @param Crawler $crawler
  * @return ExtractedOwner
  */
 public function extractOwner(Crawler $crawler)
 {
     $owner = new ExtractedOwner();
     $owner->setAvatarByUrl($crawler->filter('.project-owner-info img.profile-list-image')->attr('src'));
     $owner->setName(StringHelper::filterText($crawler, '.project-owner-info .profile-list-name a'));
     return $owner;
 }
Ejemplo n.º 3
0
 /**
  * @param Crawler $crawler
  * @return ExtractedOwner
  */
 public function extractOwner(Crawler $crawler)
 {
     $ownerImageProperty = $crawler->filter('.photo-attribution .avatar')->attr('style');
     preg_match("/background-image: url\\((.*)\\);/", $ownerImageProperty, $ownerImageOutput);
     $owner = new ExtractedOwner();
     if (count($ownerImageOutput) == 2) {
         $owner->setAvatarByUrl($ownerImageOutput[1]);
     }
     $owner->setName(StringHelper::filterText($crawler, '.owner-name:first-child'));
     return $owner;
 }
Ejemplo n.º 4
0
 /**
  * @param Crawler $crawler
  * @param $oembedData
  * @return ExtractedOwner
  */
 public function extractOwner(Crawler $crawler, $oembedData)
 {
     $owner = new ExtractedOwner();
     if (is_array($oembedData) && isset($oembedData['author_name'])) {
         $owner->setName($oembedData['author_name']);
     } else {
         $owner->setName(trim(implode("", $crawler->filter("*[rel='author']")->extract(array('_text')))));
     }
     $owner->setAvatarByUrl(trim(implode("", $crawler->filter(".portrait_lg")->extract(array('srcset')))));
     return $owner;
 }
Ejemplo n.º 5
0
 /**
  * @param Crawler $crawler
  * @return ExtractedOwner
  */
 public function extractOwner(Crawler $crawler)
 {
     $owner = new ExtractedOwner();
     $owner->setName(trim($crawler->filter('.under-title-info a:nth-child(1)')->text()));
     return $owner;
 }
Ejemplo n.º 6
0
 /**
  * @param Crawler $crawler
  * @return ExtractedOwner
  */
 public function extractOwner(Crawler $crawler)
 {
     $owner = new ExtractedOwner();
     $owner->setName(StringHelper::filterText($crawler, '.under-title-info a'));
     return $owner;
 }