Advertisement
Guest User

Untitled

a guest
Aug 8th, 2012
92
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. ////////////////////
  4. // CONFIG AREA
  5. // MAKE EDITS BELOW
  6. ///////////////////
  7.  
  8. //Enter your shoutcast 7.htm url
  9.  
  10.  
  11. $sc_url_ip = "192.169.0.1"; // <= CHANGE THIS
  12. //ex: 6x.3x.18x.14x
  13.  
  14. $sc_url_port = "8000"; // <= CHANGE THIS
  15. //ex:8000
  16.  
  17.  
  18. ////////////////////
  19. // END OF CONFIG AREA
  20. //
  21. // DO NOT EDIT BELOW
  22. // UNLESS YOU KNOW WHAT YOU ARE DOING
  23. ////////////////////
  24.  
  25. function getNowPlaying($sc_url_ip,$sc_url_port)
  26. {
  27.  
  28. $open = fsockopen($sc_url_ip,$sc_url_port,$errno,$errstr,'.5');
  29. if ($open) {
  30. fputs($open,"GET /7.html HTTP/1.1\nUser-Agent:Mozilla\n\n");
  31. stream_set_timeout($open,'1');
  32. $read = fread($open,200);
  33. $text = explode(",",$read);
  34. if($text[6] == '' || $text[6] == '</body></html>'){ $msg = ' live stream '; } else { $msg = $text[6]; }
  35. $text = 'Now Playing ('.$src.'): '.$msg;
  36. } else { return false; }
  37. fclose($open);
  38.  
  39. return $text;
  40. }
  41.  
  42. //////////////////
  43.  
  44. //get the now playing
  45.  
  46. $current_song = getNowPlaying($sc_url_ip,$sc_url_port);
  47.  
  48. print $current_song;
  49.  
  50. ?>
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement