Importing your Trakt.tv Movies to Letterboxd

Every once in a while I’m reminded that letterboxd exists, and it’s more popular for movies than my beloved trakt.tv. While my Plex-based setup can auto-scrobble movies to trakt, it can’t do the same for letterboxd, so unless I manually check in and rate movies over there, it’s not going to happen.
Unless I can automate it, which is at least in some sense possible thanks to letterboxd’s import options where you can just chuck in a CSV file of your watched movies including your rating. Looking at its documentation, I realized that shouldn’t be too hard to reproduce using my {tRakt} Get Data from 'trakt.tv' package to get my data out of trakt and into letterboxd, so here goes.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
library(tRakt)
library(dplyr)

rated_movies <- user_ratings(user = "jemus42", type = "movies")

# whittle down for the importer
rated_movies <- rated_movies %>%
  select(
    Title = title,
    imdbID = imdb,
    rating10 = rating
  )

Now I have my ratings, but to fill out the diary entries with corresponding dates I need the WatchedDate column — I don’t particularly care about having a complete / accurate movie watching history on both trakt and letterboxd, but it’s easy enough to get via the trakt API:

1
2
3
4
watched_movies <- user_watched(
  user = "jemus42",
  type = "movies"
)

Now just join the two datasets and here we go.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
watched_movies %>%
  select(
    WatchedDate = last_watched_at,
    Title = title,
    imdbID = imdb
  ) %>%
  mutate(WatchedDate = as.Date(WatchedDate)) %>%
  left_join(rated_movies, by = c("imdbID", "Title")) %>%
  readr::write_csv(
    file = "trakt-movies-letterboxd.csv",
    quote_escape = "backslash"
  )
Seems to work fine as well.

Seems to work fine as well.

Click to expand: Session Info
1
2
3
4
5
6
7
8
sess <- sessioninfo::session_info()

sess$platform %>%
  unclass() %>%
  tibble::as_tibble() %>%
  t() %>%
  knitr::kable() %>%
  kableExtra::kable_styling()
versionR version 4.0.3 Patched (2020-10-13 r79346)
osmacOS Catalina 10.15.7
systemx86_64, darwin17.0
uiX11
language(EN)
collateen_US.UTF-8
ctypeen_US.UTF-8
tzEurope/Berlin
date2020-12-27
1
2
3
4
5
sess$packages %>%
  tibble::as_tibble() %>%
  dplyr::select(package, version = ondiskversion, source) %>%
  knitr::kable() %>%
  kableExtra::kable_styling()
packageversionsource
assertthat0.2.1CRAN (R 4.0.0)
blogdown0.21CRAN (R 4.0.2)
bookdown0.21CRAN (R 4.0.2)
cli2.2.0CRAN (R 4.0.2)
codetools0.2.18CRAN (R 4.0.2)
crayon1.3.4CRAN (R 4.0.0)
curl4.3CRAN (R 4.0.0)
digest0.6.27CRAN (R 4.0.2)
dplyr1.0.2CRAN (R 4.0.2)
ellipsis0.3.1CRAN (R 4.0.0)
evaluate0.14CRAN (R 4.0.0)
fansi0.4.1CRAN (R 4.0.0)
generics0.1.0CRAN (R 4.0.2)
glue1.4.2CRAN (R 4.0.2)
here1.0.0CRAN (R 4.0.2)
hms0.5.3CRAN (R 4.0.0)
htmltools0.5.0CRAN (R 4.0.0)
httr1.4.2CRAN (R 4.0.2)
jsonlite1.7.2CRAN (R 4.0.3)
knitr1.30CRAN (R 4.0.2)
lifecycle0.2.0CRAN (R 4.0.0)
lubridate1.7.9.2CRAN (R 4.0.2)
magrittr2.0.1CRAN (R 4.0.2)
pillar1.4.7CRAN (R 4.0.2)
pkgconfig2.0.3CRAN (R 4.0.0)
purrr0.3.4CRAN (R 4.0.0)
R62.5.0CRAN (R 4.0.2)
Rcpp1.0.5CRAN (R 4.0.0)
readr1.4.0CRAN (R 4.0.2)
renv0.12.3CRAN (R 4.0.2)
rlang0.4.9CRAN (R 4.0.2)
rmarkdown2.5CRAN (R 4.0.3)
rprojroot2.0.2CRAN (R 4.0.2)
rstudioapi0.13CRAN (R 4.0.2)
sessioninfo1.1.1CRAN (R 4.0.0)
stringi1.5.3CRAN (R 4.0.2)
stringr1.4.0CRAN (R 4.0.0)
tibble3.0.4CRAN (R 4.0.2)
tidyselect1.1.0CRAN (R 4.0.0)
tRakt0.15.0.9000Github (jemus42/tRakt@786ba4d)
vctrs0.3.5CRAN (R 4.0.2)
withr2.3.0CRAN (R 4.0.2)
xfun0.19CRAN (R 4.0.2)
yaml2.2.1CRAN (R 4.0.0)