Old 8th January 2015, 17:52   #1
NoDistortion
Junior Member
 
Join Date: Jan 2015
Posts: 4
Shoutcast v1.9.8 Currently Playing

Hi there im look for a way to send the Metadata of whats playing to my website via HTML, Yes i know there is PHP and Ajax but i know HTML and im still very much learning PHP.

The website is simple and i have full access the stream (Passwords and all that) so yea.

Any and all help would be wonderful!
NoDistortion is offline   Reply With Quote
Old 20th January 2015, 06:34   #2
Ri'ins
Junior Member
 
Join Date: May 2012
Posts: 20
Hey man.

I'm using this scripts (<NEW> MixStream All-In-One StreamStats) - http://secure.bellonline.co.uk/downl...st-PHP-scripts

But got some issue with metadata when song is changing i still have information about last played song. There is the same problem with song's history.
Any1 mind how to fix it?
Ri'ins is offline   Reply With Quote
Old 20th January 2015, 14:32   #3
neralex
Major Dude
 
Join Date: Mar 2011
Posts: 576
If your websites are working with PHP you could include a php-file in your HTML document like the now-playing.php from the link that was posted by Ri'ins:

PHP Code:
<?php
echo '<div id="sc_lastsong">';
include_once 
'now-playing.php';
echo 
'</div>';
?>
Make sure that you have a jQuery library file like jquery.min.js loaded before the <script> code is started. The most CMS/blog systems are working with jQuery, then isn't needed to load the jQuery library file:

PHP Code:
<script type="text/javascript" src="jquery.min.js"></script> 
http://learn.jquery.com/about-jquery/how-jquery-works/

After that you could load the now-playing.php again with a jQuery intervall in your HTML document.

PHP Code:
<script type="text/javascript">
$(
document).ready(function(){
    var 
refreshId setInterval(function() {
        $.
get("now-playing.php", function(data) {
            $(
"#sc_lastsong").html(data);
        });
    }, 
10000); // 10000 Milliseconds = 10 Seconds
});
</script> 
neralex is offline   Reply With Quote
Old 20th January 2015, 17:22   #4
Ri'ins
Junior Member
 
Join Date: May 2012
Posts: 20
neralex, i did like in this instruction https://github.com/Wavestreaming/jquery-shoutcast, but unsuccessfully.
- Downloaded jquery.shoutcast.min.js to my site directory;
- Added scripts before </body> tag;
- And after using codes it shows me only this code.

Settings server and port number ofcourse changing to my own.




edit:

Help me plz to install like in your post.
1. So is the first step to upload jquery to site directory? (see attached screen)
Is it right?


2. Where to put this code?
PHP Code:
<script type="text/javascript" src="jquery.min.js"></script> 
On the website page?


3. Need to create a new txt file like example now-playing.php with this code?
PHP Code:
<script type="text/javascript"
$(
document).ready(function(){ 
    var 
refreshId setInterval(function() { 
        $.
get("now-playing.php", function(data) { 
            $(
"#sc_lastsong").html(data); 
        }); 
    }, 
10000); // 10000 Milliseconds = 10 Seconds 
}); 
</script> 
But how to activate this script on website page?



This is my example - http://synthway.com/popupplayer/, but song name and songs history don't refreshing during the listening radio.
Want to install jquery for my radio stats, but ever can't understand what need to do. Read many instructions but nothing works.

Will be very grateful if somebody explain me how to do it step by step.

Attached Thumbnails
Click image for larger version

Name:	step1.jpg
Views:	627
Size:	69.6 KB
ID:	51645  

Last edited by Ri'ins; 20th January 2015 at 18:26.
Ri'ins is offline   Reply With Quote
Old 20th January 2015, 19:30   #5
neralex
Major Dude
 
Join Date: Mar 2011
Posts: 576
You can't use the jquery plugin from wavestreaming with the old SHOUTcast v1.9.8 because this script required SHOUTcast DNAS v2.x ...

Try a look here again and you should find the answer where you have to place the jquery library file.

http://learn.jquery.com/about-jquery/how-jquery-works/

You can upload this file in each directory... you must only add the path to the file in the script-tag where you call it.

PHP Code:
<script type="text/javascript" src="path/to/your/jquery.min.js"></script> 
PHP Code:
<script type="text/javascript"
$(
document).ready(function(){ 
    var 
refreshId setInterval(function() { 
        $.
get("now-playing.php", function(data) { 
            $(
"#sc_lastsong").html(data); 
        }); 
    }, 
10000); // 10000 Milliseconds = 10 Seconds 
}); 
</script> 

Make sure that you have a jQuery library file like jquery.min.js loaded before the <script> code is started in your HTML document. Check again "how jquery works" and comare it. Its not hard to understand it.

The now-playing.php is a php file that you can indentify at the file extension. Here is only the PHP code inside that call the info of the current song from the SHOUTcast v1.9.8. With DNAS v2.x exists much easier ways to catch the infos.

http://secure.bellonline.co.uk/dl.php?type=d&id=6

If you are using DNAS v2.x then you can follow this instruction but don't forget this would be now totally offtopic because the question of this thread was related to SHOUTcast v1.9.8:

http://forums.winamp.com/showpost.ph...03&postcount=2
neralex is offline   Reply With Quote
Old 21st January 2015, 06:29   #6
Ri'ins
Junior Member
 
Join Date: May 2012
Posts: 20
Ty neralax. Going to learn.
Ri'ins is offline   Reply With Quote
Old 21st January 2015, 11:08   #7
Ri'ins
Junior Member
 
Join Date: May 2012
Posts: 20
neralex, i got it. Huge thx. And plz help me in the last question, cant find solution

So this is my config and it works nice
PHP Code:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src="http://test.synthway.com/jquery/jquery.shoutcast.min.js"></script>

<script>
$.SHOUTcast({
   host : '81.176.229.85',
   port : 8000,
   interval : 5000,
   stats : function(){
      $('#songtitle').text(this.get('songtitle'));
   }
}).startStats();
</script>

<script>
$.SHOUTcast({
   host : '81.176.229.85',
   port : 8000,
   playedInterval : 20000,
   played : function(tracks){
      $('ul').html('');
      $.each(tracks,function(k,track){
         $('ul').append('<li>'+track.title+'</li>');
      });
   }
}).startPlayed();
</script> 

and this code is showing history tracks:
PHP Code:
<ul id="played"></ul

But this code doesnt show current track.
PHP Code:
<p data-shoutcast-value="songtitle"></p
What's wrong?


edit: found solution - this is correct code
PHP Code:
<p id="songtitle"></p
mb this post will help some1 else.
Ri'ins is offline   Reply With Quote
Old 21st January 2015, 17:17   #8
neralex
Major Dude
 
Join Date: Mar 2011
Posts: 576
Ri'ins, I hope you know that you have all done to confuse all other vistors they are joined into this thread releated to the topic. This thread was releated to Shoutcast v1.9.8 and all that you have posted will not work with the old shoutcast version.

Simply... you are totally offtopic and that would never help someone. I don't know why is it so hard to understand to not put different things together. Congrats for destroying this thread. This is the reason why is it so hard for newbies to follow the threads here. I can't understand it, sorry!

neralex is offline   Reply With Quote
Old 21st January 2015, 17:41   #9
Ri'ins
Junior Member
 
Join Date: May 2012
Posts: 20
I just didn't want to create a new topic.
Hope the moderator will come and remove all my answers cuz i cant edit old posts.
Ri'ins is offline   Reply With Quote
Old 23rd February 2017, 07:15   #10
SamiKapoor
Junior Member
 
Join Date: Feb 2017
Posts: 1
jquery tutorial pdf

JQuery is a cross-stage JavaScript library intended to streamline the customer side scripting of HTML. jQuery's language structure is intended to make it simpler to explore an archive, jquery tutorial pdf It is free, open-source programming utilizing the tolerant MIT License. Web examination demonstrates that it is the most broadly sent JavaScript library by a vast edge. The measured way to deal with the jQuery library permits the production of intense element site pages and Web applications.
SamiKapoor is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Shoutcast > Shoutcast Technical Support

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump