├── README.md
├── example
└── example.html
├── jquery-icecast.js
└── web
└── json.xsl
/README.md:
--------------------------------------------------------------------------------
1 | # jquery-icecast.js
2 | jquery-icecast.js is a jQuery plugin that offers a simplistic way to show icecast basic stats on your website.
3 |
4 | To start using, you to do three basic things:
5 |
6 | ### 1. Mark Up
7 |
8 |
9 | ### 2. JavaScript
10 | $(function(){
11 | $('.mounts').icecast({server:"radio.example.com"});
12 | });
13 |
14 | ### 3. json.xsl
15 | place web/json.xsl into icecast web direcory.
16 |
17 | ### Options
18 | server
19 | stationlogo
20 | can be customized easily. implemented only basic needs.
21 |
22 | ### Credits
23 | - Written by [Eugene MechanisM](http://mechanism.name)
24 | - Released under [MIT License](http://www.opensource.org/licenses/mit-license.php)
25 |
26 |
--------------------------------------------------------------------------------
/example/example.html:
--------------------------------------------------------------------------------
1 | Icecast - json demo
2 |
3 |
4 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/jquery-icecast.js:
--------------------------------------------------------------------------------
1 | (function($){$.fn.icecast = function(options){$.ajaxSetup({cache:true,scriptCharset:"utf-8",contentType:"text/json;charset=utf-8"});var defaults = {server:"",stationlogo:"http://i.imgur.com/L4qoo.gif"};
2 | var options = $.extend(defaults,options);return this.each(function(){var icecast = $(this);
3 | $.getJSON('http://'+options.server+'/json.xsl?callback=',function(data){$.each(data.mounts,function(i,mount){
4 | $(icecast).append('
'+mount.title+'
'+mount.description+mount.server_name+'
Genre: '+mount.genre+'
Listeners: '+mount.listeners+' at '+mount.bitrate+'kbps
');});});});};})(jQuery);
--------------------------------------------------------------------------------
/web/json.xsl:
--------------------------------------------------------------------------------
1 |
2 |
3 | {
4 | "contact":"",
5 | "location":"",
6 | "total_listeners":"",
7 | "server_id": "",
8 | "mounts" : {
9 | "": {
10 | "server_name": "",
11 | "server_description": "",
12 | "server_type": "",
13 | "stream_start": "",
14 | "bitrate": "",
15 | "quality": "",
16 | "video_quality": "",
17 | "frame_size": "",
18 | "frame_rate": "",
19 | "listeners": "",
20 | "listener_peak": "",
21 | "genre": "",
22 | "mount": "",
23 | "server_url": "",
24 | "artist": "",
25 | "title": "",
26 | "current_song": " - "
27 | },
28 | }
29 | }
30 |
--------------------------------------------------------------------------------