The best hip-hop songs of all time, visualized
This is a educational project and not affiliated with BBC Music.
BBC Music polled over 1001 critics in 15 countries to find the best hip-hop song ever. This repo contains poll data, originally published by BBC Music, as well as code for transforming the data, adding cover artwork, and publishing charts via Datawrapper. The poll data was extracted from this article on bbc.com: The greatest hip-hop songs of all time - who voted
- Complete ranking (310 songs, ranked by critic rating)
- Complete poll data (535 entries by 107 critics and music industry folks)
Ranking the poll submissions (using R)
The ranking algorithm, as described in the BBC Music article:
We awarded 10 points for first ranked track, eight points for second ranked track, and so on down to two points for fifth place. The song with the most points won. We split ties by the total number of votes: songs with more votes ranked higher. Any ties remaining after this were split by first place votes, followed by second place votes and so on: songs with more critics placing them at higher up the lists up ranked higher.
run_analysis.R to run this algothm using R.
Publish charts to Datawrapper (using R)
create_datawrapper_chart.R for a simple script that creates a scatterplot using Datawrapper. This script uses the experimental DatawRappr R package, which needs to be installed via Devtools (
devtools::install_github("munichrocker/DatawRappr")). You'll need a Datawrapper API key, which you can obtain from https://app.datawrapper.de/account/api-tokens and then set in an
.Renviron file. See
.Renviron.sample for an example.
Get album covers from the Spotify API (using NodeJS)
npm install node load_spotify_data.js --token='YOUR-OAUTH-TOKEN'
For using the Spotify API, you need to generate an oAuth token on developer.spotify.com. Docs and a simple way to generate a token can be found here: https://developer.spotify.com/console/get-search-item.