diff options
| author | Horus3 | 2014-02-24 16:42:14 +0100 |
|---|---|---|
| committer | Horus3 | 2014-02-24 16:42:14 +0100 |
| commit | 06f945f27840b53e57795dadbc38e76f7e11ab1c (patch) | |
| tree | 689d5c7f4ffa15460c7e90f47c6a7dd59ce4e8bd /www | |
| download | random-06f945f27840b53e57795dadbc38e76f7e11ab1c.tar.gz | |
init
Diffstat (limited to 'www')
| -rw-r--r-- | www/youtube.php | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/www/youtube.php b/www/youtube.php new file mode 100644 index 0000000..ee2cc02 --- /dev/null +++ b/www/youtube.php @@ -0,0 +1,35 @@ +<?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]; + } + return $string; + } +} + +$searchstring = get_video(); + +echo $searchstring; + + +// <iframe width="560" height="315" src="//www.youtube.com/embed/" frameborder="0" allowfullscreen></iframe> |
