Skip to content

Commit

Permalink
Merged origin/main into speak-now-tv
Browse files Browse the repository at this point in the history
  • Loading branch information
wjakethompson committed Jul 5, 2023
2 parents 2e36be3 + 60a2924 commit a190a45
Show file tree
Hide file tree
Showing 19 changed files with 448 additions and 54 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@ jobs:

- name: Deploy to Netlify
if: github.event_name == 'pull_request'
uses: nwtgck/actions-netlify@v1.1
uses: nwtgck/actions-netlify@v2.0.0
with:
publish-dir: './docs/dev'
production-branch: main
github-token: ${{ secrets.GITHUB_TOKEN }}
deploy-message:
'Deploy from GHA: ${{ github.event.pull_request.title || github.event.head_commit.message }} (${{ github.sha }})'
enable-pull-request-comment: false
enable-pull-request-comment: true
enable-commit-comment: false
timeout-minutes: 1

Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export(scale_fill_taylor_b)
export(scale_fill_taylor_c)
export(scale_fill_taylor_d)
export(title_case)
export(translate_bracelet)
import(vctrs)
importFrom(ggplot2,waiver)
importFrom(lifecycle,deprecate_soft)
Expand Down
6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# taylor (development version)

* Added Spotify data for "Hits Different" after it was released to streaming as part of *Midnights (The Til Dawn Edition)*.

* Added "Snow on the Beach (More Lana Del Rey)" and "Karma (Remix)" from *Midnights (The Til Dawn Edition)*.

* New function, `translate_bracelet()` can be used to find the song and line from the first letter of each word, as is common on the Eras Tour friendship bracelets.

* Added "The Alcott" from The National's *First Two Pages of Frankenstein* to `taylor_all_songs`.

* Added Era's Tour promotional singles "All of the Girls You Loved Before," "If This Was a Movie (Taylor's Version)," "Eyes Open (Taylor's Version)," and "Safe & Sound (Taylor's Version)."
Expand Down
74 changes: 74 additions & 0 deletions R/lyric-abbreviation.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
#' Translate a friendship bracelet
#'
#' Receive a friendship bracelet at the Eras Tour but can't figure out what
#' lyrics the bracelet has abbreviated? Now you can find out!
#'
#' @param abbr The abbreviated lyrics (i.e., the first letter of each word).
#'
#' @return A character vector with the name of the song and the abbreviated
#' line.
#' @export
#'
#' @examples
#' translate_bracelet("bykmosftvfw")
#'
#' translate_bracelet("kimbkiagkitbimhotw")
translate_bracelet <- function(abbr) {
abbr <- check_character(abbr, name = "abbr")

lyric_abbr <- vapply(taylor::taylor_all_songs$lyrics,
function(.x) {
lines <-
vapply(.x$lyric,
function(.y) {
clean <- gsub("[^a-z ]", "", tolower(.y))
words <- strsplit(clean, split = " ")
letters <- strsplit(words[[1]], split = "")
start <- vapply(letters,
function(.z) {
.z[1]
},
character(1))
paste(start, collapse = "")
},
character(1))
paste(lines, collapse = "")
},
character(1))

songs <- taylor::taylor_all_songs[grep(abbr, lyric_abbr),
c("album_name", "track_name", "lyrics")]

songs$line <- vapply(songs$lyrics,
function(.x, abbr) {
words <- strsplit(paste(.x$lyric, collapse = " "),
" ")[[1]]
letters <- vapply(words,
function(.y) {
clean <- gsub("[^a-z ]", "",
tolower(.y))
word_letters <- strsplit(clean, "")
start <- vapply(word_letters,
function(.z) {
.z[1]
},
character(1))
return(start)
},
character(1))
full_string <- paste(letters, collapse = "")
position <- regexpr(abbr, full_string)

paste(words[position:(position + nchar(abbr) - 1)],
collapse = " ")
},
character(1),
abbr = abbr)

if (any(grepl("Taylor's Version", songs$track_name))) {
songs <- songs[grepl("Taylor's Version", songs$track_name), ]
}

glue::glue_data(songs,
"{track_name}: {line}\n\n")
}
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Version)*). We stan artists owning their own songs.

``` r
taylor_album_songs
#> # A tibble: 194 × 29
#> # A tibble: 197 × 29
#> album_name ep album_release track_number track_name artist featuring
#> <chr> <lgl> <date> <int> <chr> <chr> <chr>
#> 1 Taylor Swift FALSE 2006-10-24 1 Tim McGraw Taylo… <NA>
Expand All @@ -69,7 +69,7 @@ taylor_album_songs
#> 8 Taylor Swift FALSE 2006-10-24 8 Stay Beautiful Taylo… <NA>
#> 9 Taylor Swift FALSE 2006-10-24 9 Should've Sai… Taylo… <NA>
#> 10 Taylor Swift FALSE 2006-10-24 10 Mary's Song (… Taylo… <NA>
#> # ℹ 184 more rows
#> # ℹ 187 more rows
#> # ℹ 22 more variables: bonus_track <lgl>, promotional_release <date>,
#> # single_release <date>, track_release <date>, danceability <dbl>,
#> # energy <dbl>, key <int>, loudness <dbl>, mode <int>, speechiness <dbl>,
Expand All @@ -85,7 +85,7 @@ as *Taylor’s Version*.

``` r
taylor_all_songs
#> # A tibble: 278 × 29
#> # A tibble: 282 × 29
#> album_name ep album_release track_number track_name artist featuring
#> <chr> <lgl> <date> <int> <chr> <chr> <chr>
#> 1 Taylor Swift FALSE 2006-10-24 1 Tim McGraw Taylo… <NA>
Expand All @@ -98,7 +98,7 @@ taylor_all_songs
#> 8 Taylor Swift FALSE 2006-10-24 8 Stay Beautiful Taylo… <NA>
#> 9 Taylor Swift FALSE 2006-10-24 9 Should've Sai… Taylo… <NA>
#> 10 Taylor Swift FALSE 2006-10-24 10 Mary's Song (… Taylo… <NA>
#> # ℹ 268 more rows
#> # ℹ 272 more rows
#> # ℹ 22 more variables: bonus_track <lgl>, promotional_release <date>,
#> # single_release <date>, track_release <date>, danceability <dbl>,
#> # energy <dbl>, key <int>, loudness <dbl>, mode <int>, speechiness <dbl>,
Expand All @@ -115,7 +115,7 @@ taylor_albums
#> # A tibble: 14 × 5
#> album_name ep album_release metacritic_score user_score
#> <chr> <lgl> <date> <int> <dbl>
#> 1 Taylor Swift FALSE 2006-10-24 67 8.5
#> 1 Taylor Swift FALSE 2006-10-24 67 8.4
#> 2 The Taylor Swift Holiday Col… TRUE 2007-10-14 NA NA
#> 3 Beautiful Eyes TRUE 2008-07-15 NA NA
#> 4 Fearless FALSE 2008-11-11 73 8.4
Expand All @@ -127,7 +127,7 @@ taylor_albums
#> 10 folklore FALSE 2020-07-24 88 9
#> 11 evermore FALSE 2020-12-11 85 8.9
#> 12 Fearless (Taylor's Version) FALSE 2021-04-09 82 8.9
#> 13 Red (Taylor's Version) FALSE 2021-11-12 91 9
#> 13 Red (Taylor's Version) FALSE 2021-11-12 91 8.9
#> 14 Midnights FALSE 2022-10-21 85 8.3
```

Expand Down
20 changes: 10 additions & 10 deletions data-raw/album-covers.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ tribble(
"folklore", "2fenSS68JI1h4Fo296JfGr",
"evermore", "2Xoteh7uEpea4TohMxjtaq",
"Midnights", "151w1FgRZfnKZA9FEcg9Z3"
) |>
) %>%
pwalk(function(album_name, album_uri) {
album <- get_album(album_uri)
cover <- album$images |>
slice_max(order_by = height, n = 1) |>
cover <- album$images %>%
slice_max(order_by = height, n = 1) %>%
pull(url)
save_name <- str_to_lower(album_name) |>
str_replace_all("\\(taylor's version\\)", "tv") |>
save_name <- str_to_lower(album_name) %>%
str_replace_all("\\(taylor's version\\)", "tv") %>%
str_replace_all("\\ ", "-")
download.file(cover, here("inst", "album-covers", glue("{save_name}.jpeg")))
})
Expand All @@ -39,12 +39,12 @@ codes <- c("#B8396B", "#8C4F66", "#FFF5CC", "#76BAE0", "#EBBED3")
scales::show_col(codes)

new_codes <- purrr::map_dfr(codes, function(x) {
col2rgb(x) |>
tibble::as_tibble(.name_repair = ~"value", rownames = "color") |>
tidyr::pivot_wider(names_from = color, values_from = value) |>
col2rgb(x) %>%
tibble::as_tibble(.name_repair = ~"value", rownames = "color") %>%
tidyr::pivot_wider(names_from = color, values_from = value) %>%
dplyr::mutate(hex = x, .before = 1)
}) |>
dplyr::arrange(red, green, blue) |>
}) %>%
dplyr::arrange(red, green, blue) %>%
dplyr::pull(hex)

scales::show_col(new_codes)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
[Verse 1: Taylor Swift]
One night, a few moons ago
I saw flecks of what could've been lights
But it might just have been you
Passing by unbeknownst to me
Life is emotionally abusive
And time can't stop me quite like you did
And my flight was awful, thanks for asking
I'm unglued, thanks to you

[Chorus: Taylor Swift, Taylor Swift & Lana Del Rey]
And it's like snow at the beach
Weird, but fuckin' beautiful
Flying in a dream
Stars by the pocketful
You wanting me
Tonight feels impossible
But it's comin' down
No sound, it's all around

[Post-Chorus: Taylor Swift & Lana Del Rey, Lana Del Rey]
Like snow on the beach
Like snow on the beach
Like snow on the beach
Like snow, ah, ah

[Verse 2: Lana Del Rey, Taylor Swift & Lana Del Rey]
This scene feels like what I once saw on a screen
I searched "aurora borealis green"
I've never seen someone lit from within
Blurring out my periphery
My smile is like I won a contest
And to hide that would be so dishonest
And it's fine to fake it 'til you make it
'Til you do, 'til it's true

[Chorus: Taylor Swift, Taylor Swift & Lana Del Rey]
Now, it's like snow at the beach
Weird, but fuckin' beautiful
Flying in a dream
Stars by the pocketful
You wanting me
Tonight feels impossible
But it's comin' down
No sound, it's all around

[Post-Chorus: Taylor Swift & Lana Del Rey, Lana Del Rey]
Like snow on the beach (Mmm)
Like snow on the beach
Like snow on the beach (Mmm)
Like snow, ah, ah

[Bridge: Taylor Swift, Lana Del Rey, Taylor Swift & Lana Del Rey]
I (I) can't (Can't) speak, afraid to jinx it
I (I) don't (Don't) even dare to wish it
But your eyes are flying saucers from another planet
Now, I'm all for you like Janet
Can this be a real thing? Can it?

[Chorus: Taylor Swift & Lana Del Rey, Taylor Swift]
Are we falling like snow at the beach? (Snow at the beach)
Weird, but fuckin' beautiful
Flying in a dream (Flying in a dream)
Stars by the pocketful
You wanting me
Tonight feels impossible (Tonight)
But it's comin' down
No sound, it's all around

[Post-Chorus: Taylor Swift & Lana Del Rey, Lana Del Rey, Taylor Swift]
Like snow on the beach
(Mmm; Snow on the beach)
Like snow on the beach
(Snow on the beach)
Like snow on the beach
(Mmm; Snow on the beach)
Like snow, ah
But it's comin' down
No sound, it's all around
[Outro: Lana Del Rey]
Like snow on the beach
Like snow, like snow, uh-huh, yeah
84 changes: 84 additions & 0 deletions data-raw/lyrics/10c_midnights-til-dawn-edition/23_karma-rmx.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
[Intro: Ice Spice]
Karma is that girl, like (Grrah)

[Verse 1: Taylor Swift]
You're talking shit for the hell of it
Addicted to betrayal, but you're relevant
You're terrified to look down
'Cause if you dare, you'll see the glare
Of everyone you burned just to get there
It's comin' back around

[Pre-Chorus: Taylor Swift]
And I keep my side of the street clean
You wouldn't know what I mean

[Chorus: Taylor Swift]
'Cause karma is my boyfriend
Karma is a god
Karma is the breeze in my hair on the weekend
Karma's a relaxing thought
Aren't you envious that for you it's not?
Sweet like honey, karma is a cat
Purring in my lap 'cause it loves me
Flexing likе a goddamn acrobat
Me and karma vibe like that

[Verse 2: Ice Spice, Ice Spice & Taylor Swift]
Karma is your chеck's 'boutta bounce (Damn)
Karma is the fire in your house (Grrah)
And she 'boutta pop up unannounced (Like)
And she never leavin' you alone (Damn)
Watch her put ya opps on a throne (Damn)
Got you wavin' pretty white flags, feenin' for that cash
Thinkin' it'll save ya, now you switchin' up your behavior
It's okay, baby, you ain't gotta worry, karma never gets lazy
So, I keep my head up, my bread up, I won't let up (Never)
Promise that you'll never endeavor with none lesser (Ever, ever)
I be draggin' that wagon, karma is a beauty winning that pageant, grrah

[Chorus: Taylor Swift, Ice Spice, Taylor Swift & Ice Spice]
'Cause karma is my boyfriend (Damn)
Karma is a god
Karma is the breeze in my hair on the weekend
Karma's a relaxing thought
Aren't you envious that for you it's not?
Sweet like honey, karma is a cat
Purring in my lap 'cause it loves me
Flexing like a goddamn acrobat
Me and karma vibe like that (Grrah)

[Bridge: Taylor Swift]
Ask me what I learned from all those years
Ask me what I earned from all those tears
Ask me why so many fade, but I'm still here
(I'm still here, I'm still here)

[Breakdown: Taylor Swift, Ice Spice, Taylor Swift & Ice Spice]
'Cause karma is the thunder
Rattlin' your ground
Karma's on your scent like a bounty hunter
And karma's gonna track you down
Step by step, from town to town
Sweet like justice, karma is a queen
Karma takes all my friends to the summit (Facts)
Karma is the guy on the screen
Coming straight home to me

[Chorus: Taylor Swift, Ice Spice, Taylor Swift & Ice Spice]
'Cause karma is my boyfriend (Karma is my boyfriend)
Karma is a god (Damn)
Karma is the breeze in my hair on the weekend (Weekend)
Karma's a relaxing thought
Aren't you envious that for you it's not?
Sweet like honey, karma is a cat
Purring in my lap 'cause it loves me
Flexing like a goddamn acrobat
Me and karma vibe like that

[Outro: Taylor Swift, Ice Spice]
Karma is my boyfriend
Karma is a god (Ah)
Karma is my bestie (Mmm)
Karma's a relaxing thought
Karma's gonna hold you down
Loading

0 comments on commit a190a45

Please sign in to comment.