À L'Aide De Shoutcast, Écran De Lecture De L'Album De L'Art

J'ai un petit 70x70 boîte en HTML joueur que j'ai construit où je veux placer dans la pochette de l'album pour coïncider avec ma lecture en cours de l'information à partir de mon serveur shoutcast. Est-il possible, à l'aide de l'artiste de la chanson de l'information le serveur shoutcast offre, que je peux à la recherche d'un service web (amazon/dernière.fm) et l'ont lieu le (la plus probable) de la couverture de l'album là-bas?

Voici le code JS que j'utilise maintenant:

jQuery(document).ready(function() {
pollstation();
//refresh the data every 30 seconds
setInterval(pollstation, 30000);
});
//Accepts a url and a callback function to run.  
function requestCrossDomain( callback ) {  
//Take the provided url, and add it to a YQL query. Make sure you encode it!  
var yql = 'http://s7.viastreaming.net/scr/yql.php?port='+port+'&username='+user+'&callback=?';
//Request that YSQL string, and run a callback function.  
//Pass a defined function to prevent cache-busting.  
jQuery.getJSON( yql, cbFunc );
function cbFunc(data) {  
//If we have something to work with...  
if ( data ) {  
//Strip out all script tags, for security reasons. there shouldn't be any, however
data = data[0].results.replace(/<script[^>]*>[\s\S]*?<\/script>/gi, '');
data = data.replace(/<html[^>]*>/gi, '');
data = data.replace(/<\/html>/gi, '');
data = data.replace(/<body[^>]*>/gi, '');
data = data.replace(/<\/body>/gi, '');
//If the user passed a callback, and it  
//is a function, call it, and send through the data var.  
if ( typeof callback === 'function') {  
callback(data);  
}  
}  
//Else, Maybe we requested a site that doesn't exist, and nothing returned.  
else throw new Error('Nothing returned from getJSON.');  
}  
}  
function pollstation() {
requestCrossDomain(function(stationdata) {
var lines = stationdata.split('|+|');
jQuery('#sname').html(lines[0]);
jQuery('#sgenre').html(lines[1]);
jQuery('#clisteners').html(lines[2]);
jQuery('#bitrate').html(lines[3]);
jQuery('#artist_block').html('' + jQuery.trim(lines[4]) + '');
var prev = lines[5].split('+|+');
jQuery('#np_table').html('');
for (var i = 0; i < 8; i++) 
{    
if(typeof(prev[i]) != 'undefined')
{           
jQuery('#np_table').append('<tr>'+'<td>'+ prev[i] + '</td>'+'</tr>');
jQuery("tr:odd").css("background-color", "#154270");
}
}   
jQuery('#mplayers').html(lines[6]); 
jQuery('#mobile').html(lines[7]);
jQuery();
} );
}

et voici le code HTML:

<div id="col_left">
<div id="now_playing">
<div id="np_ribbon"><span>Now Playing</span></div>
<div id="np_img"><img name="nowplayingimage" src="" width="70" height="70" alt="album cover" style="background-color: #000000" /></div>
<div id="artist_block">
<span class="artist_name"><strong>Artist:</strong> Artist name</span><br />
<span class="song_name"><strong>Song:</strong> &quot;song title&quot;</span><br />
<span class="album_name"><strong>Album:</strong> Album Name</span> <br />
</div> 
<div id="player">
<div id="container"><script type="text/javascript" src="http://shoutcast.mixstream.net/js/external/flash/s7.viastreaming.net:8790:0:::999999:::1"></script></div>
</div>
</div><!-- end now playing -->
<div id="recent">
<div class="table_title">Recently Played</div>
<table id="np_table">
</table>
</div><!-- end recent -->
</div><!-- end col_left -->

Alors, naturellement, je veux faire apparaître l'image où la div "np_img" est. Les idées de ce que le code à utiliser et comment les mettre en œuvre. Vous pouvez sans doute dire par mon code que je suis un amateur de sorte s'il vous plaît être clair et doux. 🙂

InformationsquelleAutor FatimaBurke | 2012-08-09