Created
April 15, 2012 17:50
-
-
Save arekolek/2394115 to your computer and use it in GitHub Desktop.
Strike through known artists
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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