From ed80377385f9d1df0f0a31aad3102d1c2a17d755 Mon Sep 17 00:00:00 2001
From: root
Date: Thu, 27 Feb 2014 00:56:03 +0100
Subject: index
---
www/favicon.ico | Bin 0 -> 5242 bytes
www/index.php | 5 +++++
www/youtube.php | 16 ++++++++--------
3 files changed, 13 insertions(+), 8 deletions(-)
create mode 100755 www/favicon.ico
create mode 100644 www/index.php
diff --git a/www/favicon.ico b/www/favicon.ico
new file mode 100755
index 0000000..41f6475
Binary files /dev/null and b/www/favicon.ico differ
diff --git a/www/index.php b/www/index.php
new file mode 100644
index 0000000..b43b2dc
--- /dev/null
+++ b/www/index.php
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/www/youtube.php b/www/youtube.php
index 311b2c4..37654e5 100644
--- a/www/youtube.php
+++ b/www/youtube.php
@@ -1,6 +1,7 @@
Random Youtube Video
+
@@ -20,7 +21,6 @@ function searchterm(){
$db = new SQLite3("../database/dict.db");
$table_array = array("english", "german");
- $table_count = count("$table_array");
$table=$table_array[0]; // choose the language
@@ -50,7 +50,7 @@ function printVideoFeed($videoFeed)
$res_quant = count($videoFeed);
- $video = mt_rand(1, $res_quant);
+ $video = mt_rand(0, $res_quant-1);
$videoId = printVideoEntry($videoFeed[$video]);
@@ -69,26 +69,26 @@ function start($yt){
$searchstring = searchterm();
$location = $yt->newVideoQuery();
- $location->setOrderBy('viewCount');
+// $location->setOrderBy('viewCount');
$location->setSafeSearch('none');
$location->setVideoQuery($searchstring);
$videoID = getAndPrintVideoFeed($location, $yt);
- if(file_get_contents("https://gdata.youtube.com/feeds/api/videos/" . $videoID . "")){
-
+ if(fopen("https://gdata.youtube.com/feeds/api/videos/" . $videoID , "r")){
return $videoID;
} else {
start();
}
+
}
$videoID = start($yt);
?>
-A random youtube video!
>
-
+A random youtube video!
+
-Get another one!
+Get another one
--
cgit v1.2.3