diff options
| author | root | 2014-05-25 22:14:29 +0200 |
|---|---|---|
| committer | root | 2014-05-25 22:14:29 +0200 |
| commit | 7c8f6345ef35b6fca9283b5e1c23d22cf9466294 (patch) | |
| tree | 2b0f558aa7cceb30ff59edd7efc4cc0691f72e5c | |
| parent | e5e8ee54e4b404d0cbdf69bebc3d9bdd9bd04855 (diff) | |
| download | random-7c8f6345ef35b6fca9283b5e1c23d22cf9466294.tar.gz | |
new style
| -rw-r--r-- | www/.index.php.swp | bin | 12288 -> 0 bytes | |||
| -rw-r--r-- | www/Gununu_all.swf | bin | 0 -> 9882636 bytes | |||
| -rw-r--r-- | www/functions/func_yt.php | 26 | ||||
| -rw-r--r-- | www/include.php | 1 | ||||
| -rw-r--r-- | www/youtube.php | 40 |
5 files changed, 67 insertions, 0 deletions
diff --git a/www/.index.php.swp b/www/.index.php.swp Binary files differdeleted file mode 100644 index 61c46e1..0000000 --- a/www/.index.php.swp +++ /dev/null diff --git a/www/Gununu_all.swf b/www/Gununu_all.swf Binary files differnew file mode 100644 index 0000000..bfeaa75 --- /dev/null +++ b/www/Gununu_all.swf 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>"; ?> |
