Source

kexp-chrome / kexp.html

Full commit
<style>
  #r {
    font-family: Helvetica;
    font-size: 10pt;
    width: 60ex;
    text-align: center;
  }
#buy {
  color: white;
  background-color: #FEAC31;
  font-size: 6pt;
  padding: 2px;
}
</style>
<script src=jquery.js></script>
<div id=r></div>
<script>
function fetch(callback) {
  $.ajax({
    url: "http://kexp.org/s/s.aspx",
    success: function (data, textStatus, r) {
      var m = data.match(/<s>(.*)<\/s><a>(.*)<\/a><r>(.*)<\/r>/);
      var info = {
        artist: m[3],
        album: m[2],
        song: m[1]};
      info.buy = 'http://www.amazon.com/exec/obidos/external-search?mode=music&tag=kexponline-20&keyword=' + m[2] + '%20-%20' + m[1];
      callback(info);
    },
    dataType: 'text'
  });
}
function go(callback) {
  fetch(function (info) {
    $("#r").html("<b>" + info.artist + '</b>&mdash;"' + info.song + 
                 '"&nbsp;(' + info.album + ")");
    // &nbsp;&nbsp;<a id=buy>BUY</a> ;
    //$("#buy")[0].href = burl;
    setTimeout(window.close, 5000);
  });
}
$(document).ready(function() {
  go();
});
</script>