Skip to content

Instantly share code, notes, and snippets.

@arekolek
Created April 15, 2012 17:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arekolek/2394115 to your computer and use it in GitHub Desktop.
Save arekolek/2394115 to your computer and use it in GitHub Desktop.
Strike through known artists
// i'm just savin' this for later
function magic(json){
var a = {}
for(var i in json["topartists"]["artist"]){
a[json["topartists"]["artist"][i]["name"]]=true;
}
var tds = document.getElementsByClassName("subjectCell");
for(var i in tds){
var e=tds[i].getElementsByTagName("a")[0];
var artist=e.innerText;
if(a[artist]) {
e.style.textDecoration = 'line-through'
}
}
}
xhr.onreadystatechange = function() {
if(xhr.readyState==4){
magic(JSON.parse(xhr.responseText));
}
}
xhr.open("GET", "http://ws.audioscrobbler.com/2.0/?method=user.gettopartists&user=arekolek&api_key=b25b959554ed76058ac220b7b2e0a026&limit=500&format=json", true);
xhr.send();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment