Giter Site home page Giter Site logo

bbcharts's Introduction

bbcharts

Lifecycle: experimental CRAN status

bbcharts provides an interface to the Billboards top charts. There is functionality for accessing weekly charts, annual charts, and the decade end data is exported as an object bbcharts::decade_end.

Installation

You can install the latest version of bbcharts from GitHub with:

remotes::install_github("josiahparry/bbcharts")

Decade End Charts

count(bbcharts::decade_end, artist, sort = TRUE)

Year End Charts

View all possible year end charts with ye_chart_table

bbcharts::ye_chart_table

Identify which chart you would like then pass along that chart_url to year_end_bb() and the year you would like it for. Due to slight inconsistencies between charts, i.e. album, artist, and song charts, the artist and title fields may be swapped around.

year_end_bb("hot-100-songs", 1960)

Weekly Charts

You can retrieve weekly charts in a very similar manner as the yearly charts. To view the weekly charts use bbcharts::chart_table

chart_table

Provide the name of the chart you want and the week you want it for in yyyy-mm-dd format.

bb_chart("hot-100", "2017-12-10")

{bbcharts} + {genius}

Use bbcharts in conjunction with genius to get the lyrics for songs on the top charts.

library(dplyr)
library(genius)
alt <- bb_chart("alternative-songs")

alt_lyrics <- alt %>% 
  # get only the first 5 songs
  slice(1:5) %>% 
  # add lyrics to a data frame
  add_genius(artist, title, type = "lyrics")

alt_lyrics

List possible charts

You can view all possible charts to query from using the chart_table that is exported.

bbcharts::chart_table

Artist Specific Chart Data

There are a number of functions that provide Billboard chart data for a specific artist.

Listing artist charts

It is possible to list all of the charts that a given artist appears on using list_artist_charts().

list_artist_charts("Andrew Bird")

Artist songs on a specific chart

Using the information above we can list all of the songs on a chart from a given artist using get_artist_chart_history(). In this case we will look at Triple A Songs (adult alternative).

get_artist_chart_history("Andrew Bird", "triple-a")

All chart information for a given artist

We can use the add_chart_history() function in conjunction with list_artist_charts() to get all chart history for an artist.

list_artist_charts("Andrew Bird") %>% 
  add_chart_history(artist = artist, chart_url = chart_url)

You can also do this for any mix of artists.

tribble(
  ~artist, ~chart,
  "Andrew Bird", "triple-a",
  "Taylor Swift", "hot-100"
) %>% 
  add_chart_history(artist, chart)

bbcharts's People

Contributors

josiahparry avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

bbcharts's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.