// ==UserScript==
// @name           /music linked data recommendations
// @namespace      http://moustaki.org/rqommend/
// @description    Injects recommendations within /music
// @include        http://www.bbc.co.uk/music/artists/*
// ==/UserScript==

var url = window.location.href;

artist_guid = url.split("artists\/")[1];

recs_url = "http://dbtune.org/rqommend-demo/recommendations/" + artist_guid;


GM_xmlhttpRequest({
    method: "GET",
    url: recs_url,
    onload: function(responseDetails) {
      if (responseDetails.status == 200) {
      recs = responseDetails.responseText;
      var elt = document.createElement('div');
          elt.setAttribute('class', 'container');
      elt.innerHTML = "<h2>Related artists</h2><p>" + recs + "</p>";
          var rc = document.getElementById('bbc_related_content');
          rc.insertBefore(elt, rc.firstChild);
        }
      }
    });
