From: Steve Sutton Date: Tue, 16 Feb 2016 21:27:49 +0000 (-0500) Subject: new sources X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/index.cgi?a=commitdiff_plain;p=prog%2FVideoExport.git new sources --- 6a75a6fdd1e72d8094305cd64d1277e0cb5af38c diff --git a/index.php b/index.php new file mode 100644 index 0000000..35dcdd0 --- /dev/null +++ b/index.php @@ -0,0 +1,46 @@ +query($sql); +$page = new stdClass; +$page->videos = array(); +while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) { + $videoMapper + = new Toolkit_Videos_VideoMapper($dbh); + $video = $videoMapper->getVideoById($row['id'], false); + if ($video) { + $imageUrl = 'http://img.youtube.com/vi/' . $video->getVideoCode() . '/0.jpg'; + $page->videos[] = array( + 'title' => $video->getVideoTitle(), + 'url' => 'https://www.youtube.com/embed/' . $video->getVideoCode(), + 'image' => $imageUrl + ); + $fileName = cleanFileName( $video->getVideoTitle() ) ; + $saveAsFileName = './images/' . $fileName . '-' . $row['id'] .'.jpg'; + grabImage( + $imageUrl, + $saveAsFileName + ); + } +} +echo '
' . print_r( $page, true ) . '
';