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()
version R version 4.0.3 Patched (2020-10-13 r79346)
os macOS Catalina 10.15.7
system x86_64, darwin17.0
ui X11
language (EN)
collate en_US.UTF-8
ctype en_US.UTF-8
tz Europe/Berlin
date 2020-12-27
1
2
3
4
5
sess$packages %>%
  tibble::as_tibble() %>%
  dplyr::select(package, version = ondiskversion, source) %>%
  knitr::kable() %>%
  kableExtra::kable_styling()
package version source
assertthat 0.2.1 CRAN (R 4.0.0)
blogdown 0.21 CRAN (R 4.0.2)
bookdown 0.21 CRAN (R 4.0.2)
cli 2.2.0 CRAN (R 4.0.2)
codetools 0.2.18 CRAN (R 4.0.2)
crayon 1.3.4 CRAN (R 4.0.0)
curl 4.3 CRAN (R 4.0.0)
digest 0.6.27 CRAN (R 4.0.2)
dplyr 1.0.2 CRAN (R 4.0.2)
ellipsis 0.3.1 CRAN (R 4.0.0)
evaluate 0.14 CRAN (R 4.0.0)
fansi 0.4.1 CRAN (R 4.0.0)
generics 0.1.0 CRAN (R 4.0.2)
glue 1.4.2 CRAN (R 4.0.2)
here 1.0.0 CRAN (R 4.0.2)
hms 0.5.3 CRAN (R 4.0.0)
htmltools 0.5.0 CRAN (R 4.0.0)
httr 1.4.2 CRAN (R 4.0.2)
jsonlite 1.7.2 CRAN (R 4.0.3)
knitr 1.30 CRAN (R 4.0.2)
lifecycle 0.2.0 CRAN (R 4.0.0)
lubridate 1.7.9.2 CRAN (R 4.0.2)
magrittr 2.0.1 CRAN (R 4.0.2)
pillar 1.4.7 CRAN (R 4.0.2)
pkgconfig 2.0.3 CRAN (R 4.0.0)
purrr 0.3.4 CRAN (R 4.0.0)
R6 2.5.0 CRAN (R 4.0.2)
Rcpp 1.0.5 CRAN (R 4.0.0)
readr 1.4.0 CRAN (R 4.0.2)
renv 0.12.3 CRAN (R 4.0.2)
rlang 0.4.9 CRAN (R 4.0.2)
rmarkdown 2.5 CRAN (R 4.0.3)
rprojroot 2.0.2 CRAN (R 4.0.2)
rstudioapi 0.13 CRAN (R 4.0.2)
sessioninfo 1.1.1 CRAN (R 4.0.0)
stringi 1.5.3 CRAN (R 4.0.2)
stringr 1.4.0 CRAN (R 4.0.0)
tibble 3.0.4 CRAN (R 4.0.2)
tidyselect 1.1.0 CRAN (R 4.0.0)
tRakt 0.15.0.9000 Github (jemus42/tRakt@786ba4d)
vctrs 0.3.5 CRAN (R 4.0.2)
withr 2.3.0 CRAN (R 4.0.2)
xfun 0.19 CRAN (R 4.0.2)
yaml 2.2.1 CRAN (R 4.0.0)