Example #1
0
 public static function getVideoData($videoid, $customimage, $customtitle, $customdescription)
 {
     $theTitle = '';
     $Description = '';
     $theImage = '';
     $HTML_SOURCE = YouTubeGalleryMisc::getURLData('http://www.ustream.tv/recorded/' . $videoid);
     if ($HTML_SOURCE != '' and $HTML_SOURCE[0] == '<') {
         if ($customimage != '') {
             $theImage = $customimage;
         } else {
             $theImage = VideoSource_Ustream::getValueByAlmostTag($HTML_SOURCE, '<meta property="og:image" content="');
             $theImage = str_replace(',', '%2C', $theImage);
         }
         if ($customtitle == '') {
             $theTitle = VideoSource_Ustream::getValueByAlmostTag($HTML_SOURCE, '<meta property="og:title" content="');
         } else {
             $theTitle = $customtitle;
         }
         if ($customdescription == '') {
             $Description = VideoSource_Ustream::getValueByAlmostTag($HTML_SOURCE, '<meta property="og:description" content="');
         } else {
             $Description = $customdescription;
         }
         $videodata = array('videosource' => 'ustream', 'videoid' => $videoid, 'imageurl' => $theImage, 'title' => $theTitle, 'description' => $Description, 'publisheddate' => VideoSource_Ustream::getValueByAlmostTag($HTML_SOURCE, '<span data-dateformat="%F %j at %g:%i%a" data-timestamp="'), 'duration' => 0, 'rating_average' => 0, 'rating_max' => 0, 'rating_min' => 0, 'rating_numRaters' => 0, 'statistics_favoriteCount' => 0, 'statistics_viewCount' => 0, 'keywords' => '');
         return $videodata;
     } else {
         return array('videosource' => 'collegehumor', 'videoid' => $videoid, 'imageurl' => $theImage, 'title' => '***Video not found***', 'description' => $Description);
     }
 }