private function _buildVideo($index) { /* collect the pieces of the video */ $authorDisplayName = $this->_getAuthorDisplayName($index); $authorUid = $this->_getAuthorUid($index); $category = $this->_getCategory($index); $commentCount = self::_fancyNumber($this->_getRawCommentCount($index)); $description = $this->_trimDescription($this->_getDescription($index)); $duration = org_tubepress_impl_util_TimeUtils::secondsToHumanTime($this->_getDurationInSeconds($index)); $homeUrl = $this->_getHomeUrl($index); $id = $this->_getId($index); $keywordsArray = $this->_getKeywordsArray($index); $likesCount = self::_fancyNumber($this->_getRawLikeCount($index)); $ratingAverage = $this->_getRatingAverage($index); $ratingCount = self::_fancyNumber($this->_getRawRatingCount($index)); $thumbUrl = $this->_pickThumbnailUrl($this->_getThumbnailUrlsArray($index)); $timeLastUpdated = $this->_fancyTime($this->_getTimeLastUpdatedInUnixTime($index)); $timePublished = $this->_fancyTime($this->_getTimePublishedInUnixTime($index)); $title = $this->_getTitle($index); $viewCount = self::_fancyNumber($this->_getRawViewCount($index)); /* now build a video out of them */ $vid = new org_tubepress_api_video_Video(); $vid->setAuthorDisplayName($authorDisplayName); $vid->setAuthorUid($authorUid); $vid->setCategory($category); $vid->setCommentCount($commentCount); $vid->setDescription($description); $vid->setDuration($duration); $vid->setHomeUrl($homeUrl); $vid->setId($id); $vid->setKeywords($keywordsArray); $vid->setLikesCount($likesCount); $vid->setRatingAverage($ratingAverage); $vid->setRatingCount($ratingCount); $vid->setThumbnailUrl($thumbUrl); $vid->setTimeLastUpdated($timeLastUpdated); $vid->setTimePublished($timePublished); $vid->setTitle($title); $vid->setViewCount($viewCount); return $vid; }