Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
23 lines (18 sloc) 676 Bytes
import json
# run first
data = None
with open('top_tracks.json', 'r') as f:
data = json.loads(
# load the colour list grabbed from simple english wikipedia
colours = None
with open('colours.txt', 'r') as f:
colours = set([c.strip().lower() for c in f.readlines()])
for track in data['toptracks']['track']:
orig_title = track['name']
title = orig_title.lower().strip()
artist = track['artist']['name']
for word in title.split():
if word in colours:
print("'{}' - {} ({})".format(track['name'], artist, word))