mrdata71 Posted July 19, 2017 Share Posted July 19, 2017 Hello there: I just switched to a Centova cast V3 Streaming server for Shoutcast V1 and V2. I lost my ability to have a remote PHP script to show whether the current DJ is Auto DJ or the DJ that is streaming.( I had one through Makeavoice) Here is the code they used: If someone can help me with making one that would be most helpful. Thank you in advance! DJ Dataman at http://www.thepartyzoneradio.com Link to comment Share on other sites More sharing options...
James Posted July 20, 2017 Share Posted July 20, 2017 Looks like that script still works? Or is that just a sample stream? What does it look like when the DJ is streaming? To me, this could prove difficult as SHOUTcast does not output anything natively to tell whether its Auto DJ or someone DJing. The AutoDJ software is separate from SHOUTcast, so you would need to find out what Makeavoice use (Centova? WHM?), and use their API's to determine. Studiio - All-In-One Radio Communication Platform SMS | Phone Calls | Social Media | Content Link to comment Share on other sites More sharing options...
PapaBearPW Posted July 20, 2017 Share Posted July 20, 2017 Yep. Works for me too. Just one thing...the space between the s and h in refresh=10. Had to remove that space, then it seems fine. But that may have just been a typo when posting it here. http://www.lunarcaster.com Link to comment Share on other sites More sharing options...
shoutcaststreaming Posted July 20, 2017 Share Posted July 20, 2017 (edited) I think he implied that it already worked. What he asked for is a new script for his new Stream Host. Edited July 21, 2017 by shoutcaststreaming SCS - Dedicated Bandwidth Servers Shoutcast / Icecast / Windows Media Transcoding - Auto DJ - Mobile Radio - FLASH Players - Auto DJ Broadcasting World's Stream Host of the Month Link to comment Share on other sites More sharing options...
mrdata71 Posted July 21, 2017 Author Share Posted July 21, 2017 yes I need a new script for centova cast. Makeavoice uses Shoutcast 1.9.8 and Shoutca.st uses Shoutcast 2.4.7 I believe. It is Centova Cast V3 for an interface. If someone has a script that I can use and insert my server info, that would be great. DJ Dataman at http://www.thepartyzoneradio.com Link to comment Share on other sites More sharing options...
PapaBearPW Posted July 21, 2017 Share Posted July 21, 2017 In that case, there are a couple of possibilities. First one depends on knowing what Centova Cast uses for AutoDJ and if it has an api you can access to pull the needed info. So, you would need to ask them about that. The other way is to "hijack" one of the Shoutcast v2 stats and parse the xml data. That one would require your DJs to either be able to either prepend or apend the song title updates (some software provides a means to do this, including LCDJ and SAM Broadcaster) with their DJ names or use the Genre setting for this purpose. It is also possible to pull from Shoutcast v1.x but, only via the title updates means. I can help you out with some code for all that, but I would need to know what Shoutcast version? http://www.lunarcaster.com Link to comment Share on other sites More sharing options...
mrdata71 Posted July 22, 2017 Author Share Posted July 22, 2017 Believe it or not, I am using SAM 4.2.2 And what is funny is that this website also helped me make the Statistic Relays able to work. I had to rig the setup for that but it works like a champ. Thanks for helping. DJ Dataman at http://www.thepartyzoneradio.com Link to comment Share on other sites More sharing options...
PapaBearPW Posted July 22, 2017 Share Posted July 22, 2017 So, are you saying you need the script or not anymore? I'm a little confused. http://www.lunarcaster.com Link to comment Share on other sites More sharing options...
mrdata71 Posted July 22, 2017 Author Share Posted July 22, 2017 I do need the script because i cannot get it to show on the website. i never used SAM to put the DJ name on the website. I never said i did not need it anymore. DJ Dataman at http://www.thepartyzoneradio.com Link to comment Share on other sites More sharing options...
mrdata71 Posted July 22, 2017 Author Share Posted July 22, 2017 the Statistic Relays and the DJ name on the website for who is On Air are 2 different things. DJ Dataman at http://www.thepartyzoneradio.com Link to comment Share on other sites More sharing options...
PapaBearPW Posted July 22, 2017 Share Posted July 22, 2017 (edited) Give this a try and let me know how it works for you. The code itself is just a couple lines, but I thought it best to put in a good amount of comments to explain what is going on. // First we need to make a connection to your Shoutcast server stats xml page. Change host and port of the url to yours and the sid number too if needed (default is 1). $url = "http://host:port/stats?sid=1"; $xml = simplexml_load_file($url) or die("feed not loading"); // Use SERVERGENRE instead of SONGTITLE to parse DJ name from the Genre. // $genre = $xml->SERVERGENRE; // echo $genre; // Next we pull the SONGTITLE from the xml and split the variable with delimiter ":" $songTitle = $xml->SONGTITLE; $parts = explode(':', $songTitle); // $parts should now contain 2 strings of text in an array if a DJ is onair, and just one if not. // Use $parts[0] for prepended song titles and $parts[1] for appended song titles. // For prepended (DJ name before title info), DJs must prepend in the format of "DJname: " (without "s.) // For appended (DJ name after title info), DJs must append in the format of ":DJname" (without "s.) // The colon is important as it is what tells us where the DJ name ends and the Song Title begins. // Next we check if anything is in the second part of our array. if($parts[1] == ""){ // If there is nothing in the second part of the array, we know that the Auto DJ is on. echo "AutoDJ OnAir!"; // Instead of just saying AutoDJ OnAir, we can echo out an image based on one located in // a folder called djimages like this // echo "djimages/AutoDJ.jpgAuto DJ"; } else { // If $parts[1] does have text, our DJ is on. echo $parts[0]." OnAir"; // Instead of just saying DJ XYZ OnAir, we can echo out an image based on one located in // a folder called djimages where the image filename is the same as the djname used like this: // echo "djimages/".$parts[0].".jpgAuto DJ"; } ?> Edited July 22, 2017 by PapaBearPW Fixed an error in the code... http://www.lunarcaster.com Link to comment Share on other sites More sharing options...
djaubs89 Posted July 22, 2017 Share Posted July 22, 2017 that code don't work for me Link to comment Share on other sites More sharing options...
PapaBearPW Posted July 22, 2017 Share Posted July 22, 2017 Did you try it after the edit I made? There was a mistake in it that I fixed about 12 minutes before you posted. I was able to get your server info from my side. So, it should work for you too. http://www.lunarcaster.com Link to comment Share on other sites More sharing options...
mrdata71 Posted July 22, 2017 Author Share Posted July 22, 2017 (edited) I am getting an error in the code when I put it into an HTMl box on my website: SERVERGENRE; // echo $genre; // Next we pull the SONGTITLE from the xml and split the variable with delimiter ":" $songTitle = $xml->SONGTITLE; $parts = explode(':' Edited July 22, 2017 by mrdata71 something did not paste DJ Dataman at http://www.thepartyzoneradio.com Link to comment Share on other sites More sharing options...
shoutcaststreaming Posted July 22, 2017 Share Posted July 22, 2017 I tried the code and it works for me. SCS - Dedicated Bandwidth Servers Shoutcast / Icecast / Windows Media Transcoding - Auto DJ - Mobile Radio - FLASH Players - Auto DJ Broadcasting World's Stream Host of the Month Link to comment Share on other sites More sharing options...
mrdata71 Posted July 22, 2017 Author Share Posted July 22, 2017 Can you give some insight as to how you are adding this to your website? I cannot upload files to my website and have to add it in an HTML box. Yes I am still learning this and need some assistance please. I so want this code to work. I have a DJ on air right now. DJ Dataman at http://www.thepartyzoneradio.com Link to comment Share on other sites More sharing options...
PapaBearPW Posted July 22, 2017 Share Posted July 22, 2017 That is a php script. If you need to put it inside a pure html page (or box), you should probably upload the code as a php file to your server and then include the php file inside your html box by using an iframe. http://www.lunarcaster.com Link to comment Share on other sites More sharing options...
mrdata71 Posted July 23, 2017 Author Share Posted July 23, 2017 That is a php script. If you need to put it inside a pure html page (or box), you should probably upload the code as a php file to your server and then include the php file inside your html box by using an iframe. I tried to make a folder and it told me 'Wrong File Type' when i uploaded it. DJ Dataman at http://www.thepartyzoneradio.com Link to comment Share on other sites More sharing options...
PapaBearPW Posted July 23, 2017 Share Posted July 23, 2017 More details would be helpful in trying to determine what the problem is. You tried to make a folder where? Using what? Wrong File Type reported by what? For what filename exactly? http://www.lunarcaster.com Link to comment Share on other sites More sharing options...
mrdata71 Posted July 23, 2017 Author Share Posted July 23, 2017 i was trying to upload it to my Centova Cast where i send my songs so i made a new folder called PHP. I was able to upload it as an MP3 and reame it as .php but i cant access the file with iframe code. DJ Dataman at http://www.thepartyzoneradio.com Link to comment Share on other sites More sharing options...
James Posted July 24, 2017 Share Posted July 24, 2017 i was trying to upload it to my Centova Cast where i send my songs so i made a new folder called PHP. I was able to upload it as an MP3 and reame it as .php but i cant access the file with iframe code. You need to upload to your webserver, not Centova Cast. Centova Cast is for music files, your website is for hosting.. your website. Looks like you host your website through GoDaddy, either use FTP/SFTP or their web interface to upload the script. Studiio - All-In-One Radio Communication Platform SMS | Phone Calls | Social Media | Content Link to comment Share on other sites More sharing options...
mrdata71 Posted July 24, 2017 Author Share Posted July 24, 2017 OK I cannot FTP or they won tell me how to do so. Has anyone ever FTP'ed to a Godaddy site? DJ Dataman at http://www.thepartyzoneradio.com Link to comment Share on other sites More sharing options...
mrdata71 Posted July 24, 2017 Author Share Posted July 24, 2017 I also found out that the website is not hosted so i cannot upload php file to it. DJ Dataman at http://www.thepartyzoneradio.com Link to comment Share on other sites More sharing options...
shoutcaststreaming Posted July 24, 2017 Share Posted July 24, 2017 If you don't have to upload & load a PHP file, then it won't work for you. SCS - Dedicated Bandwidth Servers Shoutcast / Icecast / Windows Media Transcoding - Auto DJ - Mobile Radio - FLASH Players - Auto DJ Broadcasting World's Stream Host of the Month Link to comment Share on other sites More sharing options...
James Posted July 24, 2017 Share Posted July 24, 2017 OK I cannot FTP or they won tell me how to do so. Has anyone ever FTP'ed to a Godaddy site? https://godaddy.com/help/ftp-how-to-upload-files-96 You can FTP using the guide in their support portal above. Unless you use GoDaddy's website builder, in that case you won't be able to upload this PHP script as SCS has mentioned above. Studiio - All-In-One Radio Communication Platform SMS | Phone Calls | Social Media | Content Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now