diff options
| author | root | 2014-02-24 16:48:36 +0100 |
|---|---|---|
| committer | root | 2014-02-24 16:48:36 +0100 |
| commit | 8d0d04245732fcadb04ccdcba8244ca78f825435 (patch) | |
| tree | 29de875fb7214abde057e8d17b04420346003e80 | |
| parent | 06f945f27840b53e57795dadbc38e76f7e11ab1c (diff) | |
| download | random-8d0d04245732fcadb04ccdcba8244ca78f825435.tar.gz | |
.
| -rw-r--r-- | youtube.php | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/youtube.php b/youtube.php deleted file mode 100644 index 9b22256..0000000 --- a/youtube.php +++ /dev/null @@ -1,44 +0,0 @@ -<?php - -/* -*This generates a Youtube-ID and checks if available. This is the most stupid way I can think of. -*NO, THIS SHIT DOESN'T WORK!! You will get 404's everytime. -*/ - -$clientLibraryPath = "zend/library"; -$oldPath = set_include_path(get_include_path() . PATH_SEPARATOR . $clientLibraryPath); - -function get_video(){ - - $youtube_array = array("a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", - "r", "s", "t", "u", "v", "w", "x", "y", "z", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", - "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "_", "-", "0", "1", "2", "3", "4", - "5", "6", "7", "8", "9" ); - - $length = count($youtube_array); - - $string = ""; - - for ($i=0;$i<11;$i++){ - $index = mt_rand(0,$length-1); - $string = "$string".$youtube_array[$index]; - } - - if ($data =file_get_contents("https://gdata.youtube.com/feeds/api/videos/".$string."")){ - - $xmldata = simplexml_load_string($data); - - echo $xmldata->title[0]; - - return $string; - } else { - get_video(); - } -} - -$searchstring = get_video(); - -echo $searchstring; - - -// <iframe width="560" height="315" src="//www.youtube.com/embed/" frameborder="0" allowfullscreen></iframe> |
