index.php 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. <html>
  2. <head>
  3. <title>PI: Ridiculously Chill Internet Radio</title>
  4. <link rel="stylesheet" href="jplayer/lib/circle-player/skin/circle.player.css">
  5. <script type="text/javascript" src="jplayer/lib/jquery.min.js"></script>
  6. <script type="text/javascript" src="jplayer/dist/jplayer/jquery.jplayer.min.js"></script>
  7. <script type="text/javascript" src="jplayer/lib/circle-player/js/jquery.transform2d.js"></script>
  8. <script type="text/javascript" src="jplayer/lib/circle-player/js/jquery.grab.js"></script>
  9. <script type="text/javascript" src="jplayer/lib/circle-player/js/mod.csstransforms.min.js"></script>
  10. <script type="text/javascript" src="jplayer/lib/circle-player/js/circle.player.js"></script>
  11. <script type="text/javascript">
  12. //<![CDATA[
  13. $(document).ready(function(){
  14. /*
  15. * Instance CirclePlayer inside jQuery doc ready
  16. *
  17. * CirclePlayer(jPlayerSelector, media, options)
  18. * jPlayerSelector: String - The css selector of the jPlayer div.
  19. * media: Object - The media object used in jPlayer("setMedia",media).
  20. * options: Object - The jPlayer options.
  21. *
  22. * Multiple instances must set the cssSelectorAncestor in the jPlayer options. Defaults to "#cp_container_1" in CirclePlayer.
  23. *
  24. * The CirclePlayer uses the default supplied:"m4a, oga" if not given, which is different from the jPlayer default of supplied:"mp3"
  25. * Note that the {wmode:"window"} option is set to ensure playback in Firefox 3.6 with the Flash solution.
  26. * However, the OGA format would be used in this case with the HTML solution.
  27. */
  28. /*
  29. m4a: "http://www.jplayer.org/audio/m4a/Miaow-07-Bubble.m4a",
  30. oga: "http://www.jplayer.org/audio/ogg/Miaow-07-Bubble.ogg"
  31. http://xstream1.somafm.com:8300/;stream/1
  32. */
  33. var myCirclePlayer = new CirclePlayer("#jquery_jplayer_1",
  34. {
  35. mp3: "http://ice1.somafm.com/groovesalad-256-mp3"
  36. }, {
  37. cssSelectorAncestor: "#cp_container_1",
  38. swfPath: "dist/jplayer",
  39. wmode: "window",
  40. keyEnabled: true,
  41. supplied: "mp3",
  42. preload: "none",
  43. autoPlay: true
  44. });
  45. });
  46. //]]>
  47. </script>
  48. <style>
  49. /* #title {
  50. word-wrap: break-word;
  51. font-family: Arial;
  52. color: gray;
  53. font-size: 900%;
  54. opacity: 0.3;
  55. display: none;
  56. }*/
  57. #title {
  58. word-wrap: break-word;
  59. font-family: Arial;
  60. color: gray;
  61. font-size: 900%;
  62. opacity: 0.3;
  63. }
  64. body {
  65. margin: 0;
  66. }
  67. #cp_container_1 {
  68. position: absolute;
  69. }
  70. .graphic {
  71. width: 100%;
  72. height: 100%;
  73. margin-left: auto;
  74. margin-right: auto;
  75. }
  76. </style>
  77. </head>
  78. <body>
  79. <div style="position: absolute; width: 100%; height: 100%; overflow: hidden;">
  80. <div id="title">
  81. <?php
  82. if(stristr($_SERVER['SERVER_NAME'], 'localhost') === FALSE)
  83. {
  84. $local = 'http://tuvme.xyz/';
  85. echo 'tuvme';
  86. }
  87. else
  88. {
  89. $local = 'http://localhost/tuvme.xyz/public_html/';
  90. echo 'localhost';
  91. }
  92. ?>
  93. </div>
  94. </div>
  95. <!-- The jPlayer div must not be hidden. Keep it at the root of the body element to avoid any such problems. -->
  96. <div id="jquery_jplayer_1" class="cp-jplayer"></div>
  97. <!-- The container for the interface can go where you want to display it. Show and hide it as you need. -->
  98. <div id="cp_container_1" class="cp-container">
  99. <div class="cp-buffer-holder"> <!-- .cp-gt50 only needed when buffer is > than 50% -->
  100. <div class="cp-buffer-1"></div>
  101. <div class="cp-buffer-2"></div>
  102. </div>
  103. <div class="cp-progress-holder"> <!-- .cp-gt50 only needed when progress is > than 50% -->
  104. <div class="cp-progress-1"></div>
  105. <div class="cp-progress-2"></div>
  106. </div>
  107. <div class="cp-circle-control"></div>
  108. <ul class="cp-controls">
  109. <li><a class="cp-play" tabindex="1">play</a></li>
  110. <li><a class="cp-pause" style="display:none;" tabindex="1">pause</a></li> <!-- Needs the inline style here, or jQuery.show() uses display:inline instead of display:block -->
  111. </ul>
  112. </div>
  113. <?php
  114. $choice = 'clear';
  115. $url = 'http://api.giphy.com/v1/gifs/random?api_key=dc6zaTOxFJmzC&tag='.$choice;
  116. // Get the document at this url
  117. //$response = file_get_contents($url);
  118. $response = file_get_contents($local."giphy.php");
  119. // Parse XML with SimpleXML in PHP http://www.php.net/manual/en/simplexml.examples-basic.php
  120. $pics = json_decode($response);
  121. //echo "<pre>";
  122. //print_r($pics->data->image_url);
  123. //echo "</pre>";
  124. //exit;
  125. //var_dump($pics); // take a look at this to see what data you get back
  126. if ($choice == 'clear') {
  127. echo '';
  128. // mode: random
  129. echo '<img class="graphic" src="'.$pics->data->images->original->url.'">';
  130. } else {
  131. }
  132. ?>
  133. </body>
  134. </html>