summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorroot2014-05-25 22:14:29 +0200
committerroot2014-05-25 22:14:29 +0200
commit7c8f6345ef35b6fca9283b5e1c23d22cf9466294 (patch)
tree2b0f558aa7cceb30ff59edd7efc4cc0691f72e5c
parente5e8ee54e4b404d0cbdf69bebc3d9bdd9bd04855 (diff)
downloadrandom-7c8f6345ef35b6fca9283b5e1c23d22cf9466294.tar.gz
new style
-rw-r--r--www/.index.php.swpbin12288 -> 0 bytes
-rw-r--r--www/Gununu_all.swfbin0 -> 9882636 bytes
-rw-r--r--www/functions/func_yt.php26
-rw-r--r--www/include.php1
-rw-r--r--www/youtube.php40
5 files changed, 67 insertions, 0 deletions
diff --git a/www/.index.php.swp b/www/.index.php.swp
deleted file mode 100644
index 61c46e1..0000000
--- a/www/.index.php.swp
+++ /dev/null
Binary files differ
diff --git a/www/Gununu_all.swf b/www/Gununu_all.swf
new file mode 100644
index 0000000..bfeaa75
--- /dev/null
+++ b/www/Gununu_all.swf
Binary files differ
diff --git a/www/functions/func_yt.php b/www/functions/func_yt.php
new file mode 100644
index 0000000..4aa1e29
--- /dev/null
+++ b/www/functions/func_yt.php
@@ -0,0 +1,26 @@
+<?php
+
+function get_yt_data($id){
+ $data = file_get_contents("https://gdata.youtube.com/feeds/api/videos/".$id."");
+ $data = preg_replace("/yt:statistics/", "ytstatistics", $data);
+ $data = preg_replace("/media:group/", "mediagroup", $data);
+ $data = preg_replace("/media:description/", "mediadescription", $data);
+ $data = preg_replace("/gd:rating/", "gdrating", $data);
+ $xmldata = simplexml_load_string($data);
+
+ $title = $xmldata->title[0];
+ $viewCount = $xmldata->ytstatistics["viewCount"];
+ $author = $xmldata->author->name[0];
+ $desc = $xmldata->mediagroup->mediadescription[0];
+ $date = $xmldata->published[0];
+ $rate = $xmldata->gdrating["average"];
+
+ $res["title"] = $title;
+ $res["viewCount"] = $viewCount;
+ $res["author"] = $author;
+ $res["desc"] = $desc;
+ $res["date"] = $date;
+ $res["rate"] = $rate;
+
+ return $res;
+}
diff --git a/www/include.php b/www/include.php
index ad9562d..02b170b 100644
--- a/www/include.php
+++ b/www/include.php
@@ -3,4 +3,5 @@
$functiondir = "functions/";
require_once($functiondir . "func_youtube.php");
+require_once($functiondir . "func_yt.php");
require_once($functiondir . "func_puush.php");
diff --git a/www/youtube.php b/www/youtube.php
index b4c241b..868bd8a 100644
--- a/www/youtube.php
+++ b/www/youtube.php
@@ -16,6 +16,9 @@ if(!isset($_GET["id"])){
<meta http-equiv='Content-type' content='text/html; charset=utf-8' />
<link rel='shortcut icon' href='/favicon.ico' type='image/x-icon' />
<link rel='stylesheet' type='text/css' href='style.css'/>
+<style type='text/css'>
+ .center {text-align:left;}
+</style>
</head>
<!--body link='#000000' alink='#000000' vlink='#6a6862'>
<body link='#000000' alink='#000000' vlink='#41403d'>
@@ -32,6 +35,43 @@ include("header.php");
<iframe width="560" height="315" src="https://www.youtube.com/embed/<?php echo $videoID ?>" frameborder="0" allowfullscreen></iframe> <br><br>
<?php
+$data = get_yt_data($videoID);
+?>
+<table width='560' >
+ <tr>
+ <td class='center'>Video Titel: </td>
+ <td class='center'><?php echo $data["title"]; ?></td>
+ </tr>
+ <tr>
+ <td class='center'>Views: </td>
+ <td class='center'><?php echo $data["viewCount"]; ?></td>
+ </tr>
+ <tr>
+ <td class='center'>Rating: </td>
+ <td class='center'><?php echo $data["rate"]; ?></td>
+ </tr>
+ <tr>
+ <td class='center'>Uploader: </td>
+ <td class='center'><?php echo $data["author"]; ?></td>
+ </tr>
+ <tr>
+ <td></td><td><hr></td>
+ </tr>
+ <tr>
+ <td class='center'>Description: </td>
+ <td class='center'><?php echo $data["desc"]; ?></td>
+ </tr>
+ <tr>
+ <td></td><td><hr></td>
+ </tr>
+ <tr>
+ <td class='center'>Published: </td>
+ <td class='center'><?php echo $data["date"]; ?></td>
+ </tr>
+
+</table>
+<br><br>
+<?php
echo "<a href=\"/youtube?id=".$new_id."\">Get another one</a>";
?>