Skip to content

ewenme/geniusr

Repository files navigation

geniusr

Lifecycle: maturing CRAN status DLs Travis build Status AppVeyor build status Codecov test coverage

Overview

Tools for working with the Genius (FKA Rap Genius) API.

Install

Get the latest stable version from CRAN…

install.packages("geniusr")

…or install the development version from Github (recommended).

remotes::install_github("ewenme/geniusr")

Authenticate

  1. Create a Genius API client
  2. Generate a client access token from your API Clients page
  3. Set your credentials in the System Environment variable GENIUS_API_TOKEN by calling the genius_token() function and entering your Genius Client Access Token when prompted.

Use

Start with the basics!

How many times did ’Ye say “good morning”, on the track “Good Morning”?

library(geniusr)
library(dplyr)
library(tidytext)

# get lyrics
get_lyrics_search(artist_name = "Kanye West",
                  song_title = "Good Morning") %>% 
  # get lyric bigrams
  unnest_tokens(bigram, line, token = "ngrams", n = 2) %>%
  # look for good morning
  filter(bigram == "good morning") %>% 
  # count bigram frequency
  nrow()
#> [1] 18

Other

  • Get citation information for geniusr in R with citation(package = 'geniusr')
  • Please note that the geniusr project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.

Related work

  • the genius package specialises in lyrics retrieval from Genius.