Browse Source

More doc tweaks, overhaul credential docs

master
Lukas Burk 1 year ago
parent
commit
76c42a1fda
Signed by: lukas GPG Key ID: 044E8B20BB186F81
53 changed files with 266 additions and 189 deletions
  1. +1
    -0
      NAMESPACE
  2. +74
    -47
      R/api.R
  3. +12
    -7
      R/comments_trending.R
  4. +5
    -6
      R/user_likes.R
  5. +7
    -1
      R/utils-misc.R
  6. +2
    -0
      _pkgdown.yml
  7. +2
    -2
      man/anticipated_media.Rd
  8. +2
    -2
      man/collected_media.Rd
  9. +8
    -4
      man/comments_comment.Rd
  10. +6
    -28
      man/comments_trending.Rd
  11. +45
    -0
      man/comments_updates.Rd
  12. +1
    -1
      man/episodes_summary.Rd
  13. +2
    -2
      man/lists_popular.Rd
  14. +2
    -2
      man/media_aliases.Rd
  15. +5
    -4
      man/media_comments.Rd
  16. +4
    -4
      man/media_lists.Rd
  17. +4
    -4
      man/media_people.Rd
  18. +4
    -4
      man/media_ratings.Rd
  19. +4
    -4
      man/media_stats.Rd
  20. +3
    -3
      man/media_translations.Rd
  21. +3
    -3
      man/media_watching.Rd
  22. +1
    -1
      man/movies_boxoffice.Rd
  23. +1
    -1
      man/movies_related.Rd
  24. +1
    -1
      man/movies_releases.Rd
  25. +1
    -1
      man/movies_summary.Rd
  26. +2
    -2
      man/people_media.Rd
  27. +1
    -1
      man/people_summary.Rd
  28. +2
    -2
      man/played_media.Rd
  29. +2
    -2
      man/popular_media.Rd
  30. +2
    -2
      man/search_query.Rd
  31. +1
    -1
      man/seasons_season.Rd
  32. +1
    -1
      man/seasons_summary.Rd
  33. +2
    -2
      man/shows_next_episode.Rd
  34. +1
    -1
      man/shows_related.Rd
  35. +1
    -1
      man/shows_summary.Rd
  36. +22
    -12
      man/trakt_credentials.Rd
  37. +1
    -5
      man/trakt_get.Rd
  38. +2
    -2
      man/trending_media.Rd
  39. +2
    -2
      man/updated_media.Rd
  40. +1
    -1
      man/user_collection.Rd
  41. +2
    -1
      man/user_comments.Rd
  42. +1
    -1
      man/user_history.Rd
  43. +6
    -5
      man/user_likes.Rd
  44. +2
    -1
      man/user_list_comments.Rd
  45. +1
    -1
      man/user_list_items.Rd
  46. +1
    -1
      man/user_lists.Rd
  47. +3
    -3
      man/user_network.Rd
  48. +1
    -1
      man/user_profile.Rd
  49. +1
    -1
      man/user_ratings.Rd
  50. +1
    -1
      man/user_stats.Rd
  51. +1
    -1
      man/user_watched.Rd
  52. +1
    -1
      man/user_watchlist.Rd
  53. +2
    -2
      man/watched_media.Rd

+ 1
- 0
NAMESPACE View File

@ -173,6 +173,7 @@ importFrom(stringr,str_replace)
importFrom(stringr,str_split)
importFrom(stringr,str_to_lower)
importFrom(stringr,str_trim)
importFrom(stringr,str_trunc)
importFrom(tibble,as_tibble)
importFrom(tibble,enframe)
importFrom(tibble,remove_rownames)


+ 74
- 47
R/api.R View File

@ -1,13 +1,17 @@
#' Set the required trakt.tv API credentials
#'
#' `trakt_credentials` searches for your credentials and stores them
#' in the appropriate [options()] variables of the same name.
#' in the appropriate [environment variables][base::Sys.setenv] of the same name.
#' To make this work automatically, place your key as environment variables in
#' `~/.Renviron` (see `Details`).
#' Arguments to this function take precedence over any key file. To make API
#' functions work, you do not have to use this function unless you want to
#' supply your own client ID, which is recommended for larger data collection
#' projects.
#' Arguments to this function take precedence over any configuration file.
#'
#' This function is called automatically when the package is loaded via `library(tRakt)`
#' or `tRakt::fun` function calls – you basically never have to use it if you have
#' stored your credentials as advised.
#' Additionally, for regular (non-authenticated) API interaction, you do not have to
#' set any credentials at all because the package's `client_secret` is used as a fallback,
#' which allows you to use most functions out of the box.
#'
#' Set appropriate values in your `~/.Renviron` like this:
#'
@ -18,16 +22,22 @@
#' trakt_client_secret=f23[...]2nkjb
#' ```
#'
#' If (and only if) the environment option `trakt_client_secret` is set to a non-empty
#' string (i.e. it's not `""`), then all requests will be made using authentication.
#'
#' @param username `character(1)`: Explicitly set your trakt.tv username
#' (optional).
#' @param client_id `character(1)`: Explicitly set your API client ID
#' (required for API interaciton).
#' (required for *any* API interaction).
#' @param client_secret `character(1)`: Explicitly set your API client secret
#' (required only for *authenticated* API interaction).
#' @param silent `logical(1) [TRUE]`: No messages are printed showing you the
#' API information.
#' Mostly for debug purposes.
#' @return Nothing. Only messages.
#' API information. Mostly for debug purposes.
#' @return Invisibly: A `list` with elements `username`, `client_id` and `client_secret`,
#' where values are `TRUE` if the corresponding value is non-empty.
#' @export
#' @family API-basics
#' @importFrom stringr str_trunc
#' @examples
#' \dontrun{
#' # Use a values set in ~/.Renviron in an R session:
@ -36,40 +46,56 @@
#'
#' # Explicitly set values in an R session, overriding .Renviron values
#' trakt_credentials(
#' username = "sean",
#' client_id = "12fc1de7674[...]d5e11e3490823d629afdf2",
#' username = "jemus42",
#' client_id = "totallylegitclientsecret",
#' silent = FALSE
#' )
#' }
trakt_credentials <- function(username, client_id, silent = TRUE) {
username <- ifelse(missing(username),
Sys.getenv("trakt_username"), username
)
client_id <- ifelse(missing(client_id),
Sys.getenv("trakt_client_id"), client_id
)
trakt_credentials <- function(username,
client_id,
client_secret,
silent = TRUE) {
# Check username ----
if (!missing(username)) {
Sys.setenv("trakt_username" = username)
}
if (username != "") {
options(trakt_username = username)
if (!silent) {
message("Your trakt.tv username is set to ", getOption("trakt_username"))
}
# Check client id (required) ----
if (!missing(client_id)) {
Sys.setenv("trakt_client_id" = client_id)
}
if (client_id != "") {
options(trakt_client_id = client_id)
} else {
options(trakt_client_id = tRakt_client_id)
if (!silent) {
message(
"I provided my client_id as a fallback for you. ",
"Please use it responsibly."
)
}
# Set internal package client id if there is none yet
if (Sys.getenv("trakt_client_id") == "") {
Sys.setenv("trakt_client_id" = tRakt_client_id)
}
# check client secret (optional(ish)) ----
if (!missing(client_secret)) {
Sys.setenv("trakt_client_secret" = client_secret)
}
if (!silent) {
message(paste("Your client ID is set to", getOption("trakt_client_id")))
message("trakt username: ", Sys.getenv("trakt_username"))
message(
"trakt client id: ",
stringr::str_trunc(Sys.getenv("trakt_client_id"), width = 7, ellipsis = "...")
)
message(
"trakt client secret: ",
stringr::str_trunc(Sys.getenv("trakt_client_secret"), width = 5, ellipsis = "...")
)
}
invisible(
list(
username = Sys.getenv("trakt_username") != "",
client_id = Sys.getenv("trakt_client_id") != "",
client_secret = Sys.getenv("trakt_client_secret") != ""
)
)
}
#' Make an API call and receive parsed output
@ -97,8 +123,6 @@ trakt_credentials <- function(username, client_id, silent = TRUE) {
#' performed and its content returned. This is useful if you are only
#' interested in status codes or other headers, and don't want to waste
#' resources/bandwidth on the response body.
#' @param auth `logical(1) [FALSE]`: If `TRUE`, an authenticated request is made.
#' This requires a set client secret and manual interaction.
#' @return The parsed ([jsonlite::fromJSON()]) content of the API response.
#' An empty [tibble()][tibble::tibble-package] if the response is an empty
#' `JSON` array.
@ -121,17 +145,17 @@ trakt_credentials <- function(username, client_id, silent = TRUE) {
#'
#' # Optionally be lazy about URL specification by dropping the hostname:
#' trakt_get("shows/game-of-thrones")
trakt_get <- function(url, client_id = getOption("trakt_client_id"),
HEAD = FALSE, auth = FALSE) {
trakt_get <- function(url,
client_id = Sys.getenv("trakt_client_id"),
HEAD = FALSE) {
if (!grepl(pattern = "^https://api.trakt.tv", url)) {
url <- build_trakt_url(url)
}
if (is.null(client_id)) {
if (is.null(getOption("trakt_client_id"))) {
options(trakt_client_id = tRakt_client_id)
}
client_id <- getOption("trakt_client_id")
if (Sys.getenv("trakt_client_secret") != "") {
token <- trakt_get_token()
} else {
token <- NULL
}
# Headers and metadata
@ -150,9 +174,6 @@ trakt_get <- function(url, client_id = getOption("trakt_client_id"),
return(response)
}
token <- NULL
if (auth) token <- trakt_get_token()
response <- GET(url, headers, agent, config(token = token))
# Fail on HTTP error, i.e. 404 or 5xx.
@ -190,6 +211,12 @@ trakt_get <- function(url, client_id = getOption("trakt_client_id"),
#' @family API-basics
#' @importFrom httr oauth_endpoint oauth_app oauth2.0_token user_agent
trakt_get_token <- function() {
if (Sys.getenv("trakt_client_secret") == "") {
stop("No client secret set, can't use authentication.\n",
"See ?trakt_credentials to see how to set up your credentials.")
}
# Set up OAuth URLs
trakt_endpoint <- oauth_endpoint(
authorize = "https://trakt.tv/oauth/authorize",
@ -199,7 +226,7 @@ trakt_get_token <- function() {
# Application credentials: https://trakt.tv/oauth/applications
app <- oauth_app(
appname = "trakt",
key = getOption("trakt_client_id"),
key = Sys.getenv("trakt_client_id"),
secret = Sys.getenv("trakt_client_secret"),
redirect_uri = "urn:ietf:wg:oauth:2.0:oob"
)


+ 12
- 7
R/comments_trending.R View File

@ -1,4 +1,4 @@
#' Get trending, recent or recently updated comments
#' Get trending or recently made comments
#'
#' @name comments_trending
#' @eval apiurl("comments", "trending")
@ -15,13 +15,10 @@
#'
#' # Recent shouts (short comments)
#' comments_recent("shouts")
#'
#' # Recently updated comments
#' comments_updates()
#' }
NULL
#' @describeIn comments_trending Get trending comments.
#' @name comments_trending
#' @export
comments_trending <- function(comment_type = c("all", "reviews", "shouts"),
type = c(
@ -42,7 +39,7 @@ comments_trending <- function(comment_type = c("all", "reviews", "shouts"),
unpack_comments_multitype(response)
}
#' @describeIn comments_trending Get recently made comments.
#' @name comments_trending
#' @eval apiurl("comments", "recent")
#' @family comment methods
#' @export
@ -65,10 +62,18 @@ comments_recent <- function(comment_type = c("all", "reviews", "shouts"),
unpack_comments_multitype(response)
}
#' @describeIn comments_trending Get recently updated comments.
#' Get recently updated/edited comments
#'
#' @inheritParams user_comments
#' @inheritParams trakt_api_common_parameters
#' @inherit user_comments return
#' @export
#' @eval apiurl("comments", "updates")
#' @family comment methods
#' @export
#' @examples
#' # Recently updated comments
#' comments_updates()
comments_updates <- function(comment_type = c("all", "reviews", "shouts"),
type = c(
"all", "movies", "shows", "seasons",


+ 5
- 6
R/user_likes.R View File

@ -1,8 +1,6 @@
#' Get items (comments, lists) a user likes
#'
#' This requires authentication.
#'
#' @param type One of "comments", "lists".
#' @param type `character(1) ["comments"]`: One of "comments", "lists".
#' @inherit trakt_api_common_parameters return
#' @export
#' @family user data
@ -10,15 +8,16 @@
#' @importFrom purrr discard pluck
#' @importFrom dplyr bind_cols
#' @examples
#' # Get liked lists
#' if (FALSE) {
#' # Get liked lists (only if there's a client secret set)
#' # See ?trakt_credentials
#' if (trakt_credentials()[["client_secret"]]) {
#' user_likes("lists")
#' }
user_likes <- function(type = c("comments", "lists")) {
type <- check_types(type, several.ok = FALSE, possible_types = c("comments", "lists"))
url <- build_trakt_url("users", "likes", type)
response <- trakt_get(url, auth = TRUE)
response <- trakt_get(url)
if (type == "comments") {
response %>%


+ 7
- 1
R/utils-misc.R View File

@ -124,6 +124,12 @@ apiurl <- function(section, method, prefix = "@source ") {
stop("Please install the 'glue' package")
}
glue::glue('{prefix} [{apidoc(section, method, "endpoint")}]({apidoc(section, method, "url")})')
func <- apidoc("users", "profile", "implementation")
endpoint <- apidoc(section, method, "endpoint")
url <- apidoc(section, method, "url")
authenticated <- isTRUE(apidoc(section, method, "authentication"))
authenticated <- ifelse(authenticated, " (Authentication required)", "")
glue::glue('{prefix} {func} wraps endpoint [{endpoint}]({url}) {authenticated}')
}

+ 2
- 0
_pkgdown.yml View File

@ -15,6 +15,8 @@ authors:
reference:
- title: Basic API interaction
desc: >
These functions are basic building blocks – you don't have to use them directly.
contents:
- trakt_get
- trakt_credentials


+ 2
- 2
man/anticipated_media.Rd View File

@ -6,9 +6,9 @@
\alias{shows_anticipated}
\title{Anticipated media}
\source{
\href{https://trakt.docs.apiary.io/#reference/movies/anticipated/get-the-most-anticipated-movies}{movies/anticipated}
user_profile() wraps endpoint \href{https://trakt.docs.apiary.io/#reference/movies/anticipated/get-the-most-anticipated-movies}{movies/anticipated}
\href{https://trakt.docs.apiary.io/#reference/shows/anticipated/get-the-most-anticipated-shows}{shows/anticipated}
user_profile() wraps endpoint \href{https://trakt.docs.apiary.io/#reference/shows/anticipated/get-the-most-anticipated-shows}{shows/anticipated}
}
\usage{
movies_anticipated(limit = 10, extended = c("min", "full"),


+ 2
- 2
man/collected_media.Rd View File

@ -6,9 +6,9 @@
\alias{shows_collected}
\title{Most collected media}
\source{
\href{https://trakt.docs.apiary.io/#reference/movies/collected/get-the-most-collected-movies}{movies/collected/:period}
user_profile() wraps endpoint \href{https://trakt.docs.apiary.io/#reference/movies/collected/get-the-most-collected-movies}{movies/collected/:period}
\href{https://trakt.docs.apiary.io/#reference/shows/collected/get-the-most-collected-shows}{shows/collected/:period}
user_profile() wraps endpoint \href{https://trakt.docs.apiary.io/#reference/shows/collected/get-the-most-collected-shows}{shows/collected/:period}
}
\usage{
movies_collected(limit = 10, extended = c("min", "full"),


+ 8
- 4
man/comments_comment.Rd View File

@ -7,13 +7,13 @@
\alias{comments_item}
\title{Get a single comment}
\source{
\href{https://trakt.docs.apiary.io/#reference/comments/comment/get-a-comment-or-reply}{comments/:id}
user_profile() wraps endpoint \href{https://trakt.docs.apiary.io/#reference/comments/comment/get-a-comment-or-reply}{comments/:id}
\href{https://trakt.docs.apiary.io/#reference/comments/replies/get-replies-for-a-comment}{comments/:id/replies}
user_profile() wraps endpoint \href{https://trakt.docs.apiary.io/#reference/comments/replies/get-replies-for-a-comment}{comments/:id/replies}
\href{https://trakt.docs.apiary.io/#reference/comments/likes/get-all-users-who-liked-a-comment}{comments/:id/likes}
user_profile() wraps endpoint \href{https://trakt.docs.apiary.io/#reference/comments/likes/get-all-users-who-liked-a-comment}{comments/:id/likes}
\href{https://trakt.docs.apiary.io/#reference/comments/item/get-the-attached-media-item}{comments/:id/item}
user_profile() wraps endpoint \href{https://trakt.docs.apiary.io/#reference/comments/item/get-the-attached-media-item}{comments/:id/item}
}
\usage{
comments_comment(id, extended = c("min", "full"))
@ -85,6 +85,7 @@ comments_item("136632", extended = "full")
}
\seealso{
Other comment methods: \code{\link{comments_trending}},
\code{\link{comments_updates}},
\code{\link{media_comments}},
\code{\link{user_comments}},
\code{\link{user_list_comments}}
@ -96,16 +97,19 @@ Other summary methods: \code{\link{episodes_summary}},
\code{\link{shows_summary}}, \code{\link{user_profile}}
Other comment methods: \code{\link{comments_trending}},
\code{\link{comments_updates}},
\code{\link{media_comments}},
\code{\link{user_comments}},
\code{\link{user_list_comments}}
Other comment methods: \code{\link{comments_trending}},
\code{\link{comments_updates}},
\code{\link{media_comments}},
\code{\link{user_comments}},
\code{\link{user_list_comments}}
Other comment methods: \code{\link{comments_trending}},
\code{\link{comments_updates}},
\code{\link{media_comments}},
\code{\link{user_comments}},
\code{\link{user_list_comments}}


+ 6
- 28
man/comments_trending.Rd View File

@ -3,14 +3,11 @@
\name{comments_trending}
\alias{comments_trending}
\alias{comments_recent}
\alias{comments_updates}
\title{Get trending, recent or recently updated comments}
\title{Get trending or recently made comments}
\source{
\href{https://trakt.docs.apiary.io/#reference/comments/trending/get-trending-comments}{comments/trending/:comment_type/:type?include_replies=}
user_profile() wraps endpoint \href{https://trakt.docs.apiary.io/#reference/comments/trending/get-trending-comments}{comments/trending/:comment_type/:type?include_replies=}
\href{https://trakt.docs.apiary.io/#reference/comments/recent/get-recently-created-comments}{comments/recent/:comment_type/:type?include_replies=}
\href{https://trakt.docs.apiary.io/#reference/comments/updates/get-recently-updated-comments}{comments/updates/:comment_type/:type?include_replies=}
user_profile() wraps endpoint \href{https://trakt.docs.apiary.io/#reference/comments/recent/get-recently-created-comments}{comments/recent/:comment_type/:type?include_replies=}
}
\usage{
comments_trending(comment_type = c("all", "reviews", "shouts"),
@ -20,10 +17,6 @@ comments_trending(comment_type = c("all", "reviews", "shouts"),
comments_recent(comment_type = c("all", "reviews", "shouts"),
type = c("all", "movies", "shows", "seasons", "episodes", "lists"),
include_replies = FALSE, limit = 10L)
comments_updates(comment_type = c("all", "reviews", "shouts"),
type = c("all", "movies", "shows", "seasons", "episodes", "lists"),
include_replies = FALSE, limit = 10L)
}
\arguments{
\item{comment_type}{\code{character(1) ["all"]}: The type of comment, one of "all",
@ -43,17 +36,8 @@ A \link[tibble:tibble-package]{tibble()}. If the function has a \code{limit} par
If there are no results (or the API is unreachable), an empty \code{tibble()} is returned.
}
\description{
Get trending, recent or recently updated comments
Get trending or recently made comments
}
\section{Functions}{
\itemize{
\item \code{comments_trending}: Get trending comments.
\item \code{comments_recent}: Get recently made comments.
\item \code{comments_updates}: Get recently updated comments.
}}
\examples{
\dontrun{
# Trending reviews
@ -61,23 +45,17 @@ comments_trending("reviews")
# Recent shouts (short comments)
comments_recent("shouts")
# Recently updated comments
comments_updates()
}
}
\seealso{
Other comment methods: \code{\link{comments_comment}},
\code{\link{comments_updates}},
\code{\link{media_comments}},
\code{\link{user_comments}},
\code{\link{user_list_comments}}
Other comment methods: \code{\link{comments_comment}},
\code{\link{media_comments}},
\code{\link{user_comments}},
\code{\link{user_list_comments}}
Other comment methods: \code{\link{comments_comment}},
\code{\link{comments_updates}},
\code{\link{media_comments}},
\code{\link{user_comments}},
\code{\link{user_list_comments}}


+ 45
- 0
man/comments_updates.Rd View File

@ -0,0 +1,45 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/comments_trending.R
\name{comments_updates}
\alias{comments_updates}
\title{Get recently updated/edited comments}
\source{
user_profile() wraps endpoint \href{https://trakt.docs.apiary.io/#reference/comments/updates/get-recently-updated-comments}{comments/updates/:comment_type/:type?include_replies=}
}
\usage{
comments_updates(comment_type = c("all", "reviews", "shouts"),
type = c("all", "movies", "shows", "seasons", "episodes", "lists"),
include_replies = FALSE, limit = 10L)
}
\arguments{
\item{comment_type}{\code{character(1) ["all"]}: The type of comment, one of "all",
"reviews" or "shouts".}
\item{type}{\code{character(1) ["all"]}: The type of media to filter by, one of
"all", "movies", "shows", "seasons", "episodes" or "lists".}
\item{include_replies}{\code{logical(1) [FALSE]}: Whether to include replies.}
\item{limit}{\code{integer(1) [10L]}: Number of items to return. Must be greater
than \code{0} and will be coerced via \code{as.integer()}.}
}
\value{
A \link[tibble:tibble-package]{tibble()}. If the function has a \code{limit} parameter
(defaulting to \code{10}), this will be the (maximum) number of rows of the \code{tibble}.
If there are no results (or the API is unreachable), an empty \code{tibble()} is returned.
}
\description{
Get recently updated/edited comments
}
\examples{
# Recently updated comments
comments_updates()
}
\seealso{
Other comment methods: \code{\link{comments_comment}},
\code{\link{comments_trending}},
\code{\link{media_comments}},
\code{\link{user_comments}},
\code{\link{user_list_comments}}
}
\concept{comment methods}

+ 1
- 1
man/episodes_summary.Rd View File

@ -4,7 +4,7 @@
\alias{episodes_summary}
\title{Get a single episode's details}
\source{
\href{https://trakt.docs.apiary.io/#reference/episodes/summary/get-a-single-episode-for-a-show}{shows/:id/seasons/:season/episodes/:episode}
user_profile() wraps endpoint \href{https://trakt.docs.apiary.io/#reference/episodes/summary/get-a-single-episode-for-a-show}{shows/:id/seasons/:season/episodes/:episode}
}
\usage{
episodes_summary(id, season = 1L, episode = 1L, extended = c("min",


+ 2
- 2
man/lists_popular.Rd View File

@ -5,9 +5,9 @@
\alias{lists_trending}
\title{Get popular / trending lists}
\source{
\href{https://trakt.docs.apiary.io/#reference/lists/popular/get-popular-lists}{lists/popular}
user_profile() wraps endpoint \href{https://trakt.docs.apiary.io/#reference/lists/popular/get-popular-lists}{lists/popular}
\href{https://trakt.docs.apiary.io/#reference/lists/trending/get-trending-lists}{lists/trending}
user_profile() wraps endpoint \href{https://trakt.docs.apiary.io/#reference/lists/trending/get-trending-lists}{lists/trending}
}
\usage{
lists_popular(limit = 10)


+ 2
- 2
man/media_aliases.Rd View File

@ -6,9 +6,9 @@
\alias{shows_aliases}
\title{Get all movie / show aliases}
\source{
\href{https://trakt.docs.apiary.io/#reference/movies/aliases/get-all-movie-aliases}{movies/:id/aliases}
user_profile() wraps endpoint \href{https://trakt.docs.apiary.io/#reference/movies/aliases/get-all-movie-aliases}{movies/:id/aliases}
\href{https://trakt.docs.apiary.io/#reference/shows/summary/get-all-show-aliases}{shows/:id/aliases}
user_profile() wraps endpoint \href{https://trakt.docs.apiary.io/#reference/shows/summary/get-all-show-aliases}{shows/:id/aliases}
}
\usage{
movies_aliases(id)


+ 5
- 4
man/media_comments.Rd View File

@ -8,13 +8,13 @@
\alias{episodes_comments}
\title{Get all comments of a thing}
\source{
\href{https://trakt.docs.apiary.io/#reference/movies/comments/get-all-movie-comments}{movies/:id/comments/:sort}
user_profile() wraps endpoint \href{https://trakt.docs.apiary.io/#reference/movies/comments/get-all-movie-comments}{movies/:id/comments/:sort}
\href{https://trakt.docs.apiary.io/#reference/shows/comments/get-all-show-comments}{shows/:id/comments/:sort}
user_profile() wraps endpoint \href{https://trakt.docs.apiary.io/#reference/shows/comments/get-all-show-comments}{shows/:id/comments/:sort}
\href{https://trakt.docs.apiary.io/#reference/seasons/comments/get-all-season-comments}{shows/:id/seasons/:season/comments/:sort}
user_profile() wraps endpoint \href{https://trakt.docs.apiary.io/#reference/seasons/comments/get-all-season-comments}{shows/:id/seasons/:season/comments/:sort}
\href{https://trakt.docs.apiary.io/#reference/episodes/comments/get-all-episode-comments}{shows/:id/seasons/:season/episodes/:episode/comments/:sort}
user_profile() wraps endpoint \href{https://trakt.docs.apiary.io/#reference/episodes/comments/get-all-episode-comments}{shows/:id/seasons/:season/episodes/:episode/comments/:sort}
}
\usage{
movies_comments(id, sort = c("newest", "oldest", "likes", "replies"),
@ -86,6 +86,7 @@ episodes_comments(46241, season = 1, episode = 2, sort = "likes")
\seealso{
Other comment methods: \code{\link{comments_comment}},
\code{\link{comments_trending}},
\code{\link{comments_updates}},
\code{\link{user_comments}},
\code{\link{user_list_comments}}


+ 4
- 4
man/media_lists.Rd View File

@ -9,13 +9,13 @@
\alias{people_lists}
\title{Get lists containing a movie, show, season, episode or person}
\source{
\href{https://trakt.docs.apiary.io/#reference/movies/lists/get-lists-containing-this-movie}{movies/:id/lists/:type/:sort}
user_profile() wraps endpoint \href{https://trakt.docs.apiary.io/#reference/movies/lists/get-lists-containing-this-movie}{movies/:id/lists/:type/:sort}
\href{https://trakt.docs.apiary.io/#reference/shows/lists/get-lists-containing-this-show}{shows/:id/lists/:type/:sort}
user_profile() wraps endpoint \href{https://trakt.docs.apiary.io/#reference/shows/lists/get-lists-containing-this-show}{shows/:id/lists/:type/:sort}
\href{https://trakt.docs.apiary.io/#reference/seasons/lists/get-lists-containing-this-season}{shows/:id/seasons/:season/lists/:type/:sort}
user_profile() wraps endpoint \href{https://trakt.docs.apiary.io/#reference/seasons/lists/get-lists-containing-this-season}{shows/:id/seasons/:season/lists/:type/:sort}
\href{https://trakt.docs.apiary.io/#reference/episodes/lists/get-lists-containing-this-episode}{shows/:id/seasons/:season/episodes/:episode/lists/:type/:sort}
user_profile() wraps endpoint \href{https://trakt.docs.apiary.io/#reference/episodes/lists/get-lists-containing-this-episode}{shows/:id/seasons/:season/episodes/:episode/lists/:type/:sort}
}
\usage{
movies_lists(id, type = c("all", "personal", "official", "watchlists"),


+ 4
- 4
man/media_people.Rd View File

@ -8,13 +8,13 @@
\alias{episodes_people}
\title{Get the cast and crew of a show or movie}
\source{
\href{https://trakt.docs.apiary.io/#reference/movies/people/get-all-people-for-a-movie}{movies/:id/people}
user_profile() wraps endpoint \href{https://trakt.docs.apiary.io/#reference/movies/people/get-all-people-for-a-movie}{movies/:id/people}
\href{https://trakt.docs.apiary.io/#reference/shows/people/get-all-people-for-a-show}{shows/:id/people}
user_profile() wraps endpoint \href{https://trakt.docs.apiary.io/#reference/shows/people/get-all-people-for-a-show}{shows/:id/people}
\href{https://trakt.docs.apiary.io/#reference/seasons/people/get-all-people-for-a-season}{shows/:id/seasons/:season/people}
user_profile() wraps endpoint \href{https://trakt.docs.apiary.io/#reference/seasons/people/get-all-people-for-a-season}{shows/:id/seasons/:season/people}
\href{https://trakt.docs.apiary.io/#reference/episodes/people/get-all-people-for-an-episode}{shows/:id/seasons/:season/episodes/:episode/people}
user_profile() wraps endpoint \href{https://trakt.docs.apiary.io/#reference/episodes/people/get-all-people-for-an-episode}{shows/:id/seasons/:season/episodes/:episode/people}
}
\usage{
movies_people(id, extended = c("min", "full"))


+ 4
- 4
man/media_ratings.Rd View File

@ -8,13 +8,13 @@
\alias{episodes_ratings}
\title{Media user ratings}
\source{
\href{https://trakt.docs.apiary.io/#reference/shows/ratings/get-show-ratings}{shows/:ids/ratings}
user_profile() wraps endpoint \href{https://trakt.docs.apiary.io/#reference/shows/ratings/get-show-ratings}{shows/:ids/ratings}
\href{https://trakt.docs.apiary.io/#reference/movies/ratings/get-movie-ratings}{movies/:id/ratings}
user_profile() wraps endpoint \href{https://trakt.docs.apiary.io/#reference/movies/ratings/get-movie-ratings}{movies/:id/ratings}
\href{https://trakt.docs.apiary.io/#reference/seasons/ratings/get-season-ratings}{shows/:id/seasons/:season/ratings}
user_profile() wraps endpoint \href{https://trakt.docs.apiary.io/#reference/seasons/ratings/get-season-ratings}{shows/:id/seasons/:season/ratings}
\href{https://trakt.docs.apiary.io/#reference/episodes/ratings/get-episode-ratings}{shows/:id/seasons/:season/episodes/:episode/ratings}
user_profile() wraps endpoint \href{https://trakt.docs.apiary.io/#reference/episodes/ratings/get-episode-ratings}{shows/:id/seasons/:season/episodes/:episode/ratings}
}
\usage{
shows_ratings(id)


+ 4
- 4
man/media_stats.Rd View File

@ -8,13 +8,13 @@
\alias{episodes_stats}
\title{Get a show or movie's (or season's or episode's) stats}
\source{
\href{https://trakt.docs.apiary.io/#reference/shows/stats/get-show-stats}{shows/:id/stats}
user_profile() wraps endpoint \href{https://trakt.docs.apiary.io/#reference/shows/stats/get-show-stats}{shows/:id/stats}
\href{https://trakt.docs.apiary.io/#reference/movies/stats/get-movie-stats}{movies/:id/stats}
user_profile() wraps endpoint \href{https://trakt.docs.apiary.io/#reference/movies/stats/get-movie-stats}{movies/:id/stats}
\href{https://trakt.docs.apiary.io/#reference/seasons/stats/get-season-stats}{shows/:id/seasons/:season/stats}
user_profile() wraps endpoint \href{https://trakt.docs.apiary.io/#reference/seasons/stats/get-season-stats}{shows/:id/seasons/:season/stats}
\href{https://trakt.docs.apiary.io/#reference/episodes/stats/get-episode-stats}{shows/:id/seasons/:season/episodes/:episode/stats}
user_profile() wraps endpoint \href{https://trakt.docs.apiary.io/#reference/episodes/stats/get-episode-stats}{shows/:id/seasons/:season/episodes/:episode/stats}
}
\usage{
shows_stats(id)


+ 3
- 3
man/media_translations.Rd View File

@ -7,11 +7,11 @@
\alias{episodes_translations}
\title{Get translations for a movie, show or episode}
\source{
\href{https://trakt.docs.apiary.io/#reference/movies/translations/get-all-movie-translations}{movies/:id/translations/:language}
user_profile() wraps endpoint \href{https://trakt.docs.apiary.io/#reference/movies/translations/get-all-movie-translations}{movies/:id/translations/:language}
\href{https://trakt.docs.apiary.io/#reference/shows/translations/get-all-show-translations}{shows/:id/translations/:language}
user_profile() wraps endpoint \href{https://trakt.docs.apiary.io/#reference/shows/translations/get-all-show-translations}{shows/:id/translations/:language}
\href{https://trakt.docs.apiary.io/#reference/episodes/translations/get-all-episode-translations}{shows/:id/seasons/:season/episodes/:episode/translations/:language}
user_profile() wraps endpoint \href{https://trakt.docs.apiary.io/#reference/episodes/translations/get-all-episode-translations}{shows/:id/seasons/:season/episodes/:episode/translations/:language}
}
\usage{
movies_translations(id, languages = NULL)


+ 3
- 3
man/media_watching.Rd View File

@ -8,11 +8,11 @@
\alias{episodes_watching}
\title{Get who's watching a thing right now}
\source{
\href{https://trakt.docs.apiary.io/#reference/movies/watching/get-users-watching-right-now}{movies/:id/watching}
user_profile() wraps endpoint \href{https://trakt.docs.apiary.io/#reference/movies/watching/get-users-watching-right-now}{movies/:id/watching}
\href{https://trakt.docs.apiary.io/#reference/shows/watching/get-users-watching-right-now}{shows/:id/watching}
user_profile() wraps endpoint \href{https://trakt.docs.apiary.io/#reference/shows/watching/get-users-watching-right-now}{shows/:id/watching}
\href{https://trakt.docs.apiary.io/#reference/episodes/watching/get-users-watching-right-now}{shows/:id/seasons/:season/episodes/:episode/watching}
user_profile() wraps endpoint \href{https://trakt.docs.apiary.io/#reference/episodes/watching/get-users-watching-right-now}{shows/:id/seasons/:season/episodes/:episode/watching}
}
\usage{
movies_watching(id, extended = c("min", "full"))


+ 1
- 1
man/movies_boxoffice.Rd View File

@ -4,7 +4,7 @@
\alias{movies_boxoffice}
\title{Get the weekend box office}
\source{
\href{https://trakt.docs.apiary.io/#reference/movies/box-office/get-the-weekend-box-office}{movies/boxoffice}
user_profile() wraps endpoint \href{https://trakt.docs.apiary.io/#reference/movies/box-office/get-the-weekend-box-office}{movies/boxoffice}
}
\usage{
movies_boxoffice(extended = c("min", "full"))


+ 1
- 1
man/movies_related.Rd View File

@ -4,7 +4,7 @@
\alias{movies_related}
\title{Get similiar(ish) movies}
\source{
\href{https://trakt.docs.apiary.io/#reference/movies/related/get-related-movies}{movies/:id/related}
user_profile() wraps endpoint \href{https://trakt.docs.apiary.io/#reference/movies/related/get-related-movies}{movies/:id/related}
}
\usage{
movies_related(id, limit = 10L, extended = c("min", "full"))


+ 1
- 1
man/movies_releases.Rd View File

@ -4,7 +4,7 @@
\alias{movies_releases}
\title{Get a movie's release details}
\source{
\href{https://trakt.docs.apiary.io/#reference/movies/releases/get-all-movie-releases}{movies/:id/releases/:country}
user_profile() wraps endpoint \href{https://trakt.docs.apiary.io/#reference/movies/releases/get-all-movie-releases}{movies/:id/releases/:country}
}
\usage{
movies_releases(id, country = NULL)


+ 1
- 1
man/movies_summary.Rd View File

@ -4,7 +4,7 @@
\alias{movies_summary}
\title{Get a single movie}
\source{
\href{https://trakt.docs.apiary.io/#reference/movies/summary/get-a-movie}{movies/:id}
user_profile() wraps endpoint \href{https://trakt.docs.apiary.io/#reference/movies/summary/get-a-movie}{movies/:id}
}
\usage{
movies_summary(id, extended = c("min", "full"))


+ 2
- 2
man/people_media.Rd View File

@ -6,9 +6,9 @@
\alias{people_shows}
\title{Get a single person's movie or show credits}
\source{
\href{https://trakt.docs.apiary.io/#reference/people/movies/get-movie-credits}{people/:id/movies}
user_profile() wraps endpoint \href{https://trakt.docs.apiary.io/#reference/people/movies/get-movie-credits}{people/:id/movies}
\href{https://trakt.docs.apiary.io/#reference/people/shows/get-show-credits}{people/:id/shows}
user_profile() wraps endpoint \href{https://trakt.docs.apiary.io/#reference/people/shows/get-show-credits}{people/:id/shows}
}
\usage{
people_movies(id, extended = c("min", "full"))


+ 1
- 1
man/people_summary.Rd View File

@ -4,7 +4,7 @@
\alias{people_summary}
\title{Get a single person's details}
\source{
\href{https://trakt.docs.apiary.io/#reference/people/summary/get-a-single-person}{people/:id}
user_profile() wraps endpoint \href{https://trakt.docs.apiary.io/#reference/people/summary/get-a-single-person}{people/:id}
}
\usage{
people_summary(id, extended = c("min", "full"))


+ 2
- 2
man/played_media.Rd View File

@ -6,9 +6,9 @@
\alias{shows_played}
\title{Most played media}
\source{
\href{https://trakt.docs.apiary.io/#reference/movies/played/get-the-most-played-movies}{movies/played/:period}
user_profile() wraps endpoint \href{https://trakt.docs.apiary.io/#reference/movies/played/get-the-most-played-movies}{movies/played/:period}
\href{https://trakt.docs.apiary.io/#reference/shows/played/get-the-most-played-shows}{shows/played/:period}
user_profile() wraps endpoint \href{https://trakt.docs.apiary.io/#reference/shows/played/get-the-most-played-shows}{shows/played/:period}
}
\usage{
movies_played(limit = 10, extended = c("min", "full"),


+ 2
- 2
man/popular_media.Rd View File

@ -6,9 +6,9 @@
\alias{shows_popular}
\title{Popular media}
\source{
\href{https://trakt.docs.apiary.io/#reference/movies/popular/get-popular-movies}{movies/popular}
user_profile() wraps endpoint \href{https://trakt.docs.apiary.io/#reference/movies/popular/get-popular-movies}{movies/popular}
\href{https://trakt.docs.apiary.io/#reference/shows/popular/get-popular-shows}{shows/popular}
user_profile() wraps endpoint \href{https://trakt.docs.apiary.io/#reference/shows/popular/get-popular-shows}{shows/popular}
}
\usage{
movies_popular(limit = 10, extended = c("min", "full"), query = NULL,


+ 2
- 2
man/search_query.Rd View File

@ -5,9 +5,9 @@
\alias{search_id}
\title{Search trakt.tv via text query or ID}
\source{
\href{https://trakt.docs.apiary.io/#reference/search/text-query/get-text-query-results}{search/:type?query=}
user_profile() wraps endpoint \href{https://trakt.docs.apiary.io/#reference/search/text-query/get-text-query-results}{search/:type?query=}
\href{https://trakt.docs.apiary.io/#reference/search/id-lookup/get-text-query-results}{search/:id_type/:id?type=}
user_profile() wraps endpoint \href{https://trakt.docs.apiary.io/#reference/search/id-lookup/get-text-query-results}{search/:id_type/:id?type=}
}
\usage{
search_query(query, type = "show", n_results = 1L,


+ 1
- 1
man/seasons_season.Rd View File

@ -4,7 +4,7 @@
\alias{seasons_season}
\title{Get a season of a show}
\source{
\href{https://trakt.docs.apiary.io/#reference/seasons/season/get-single-season-for-a-show}{shows/id/seasons/season}
user_profile() wraps endpoint \href{https://trakt.docs.apiary.io/#reference/seasons/season/get-single-season-for-a-show}{shows/id/seasons/season}
}
\usage{
seasons_season(id, seasons = 1L, extended = c("min", "full"))


+ 1
- 1
man/seasons_summary.Rd View File

@ -4,7 +4,7 @@
\alias{seasons_summary}
\title{Get a show's seasons}
\source{
\href{https://trakt.docs.apiary.io/#reference/seasons/summary/get-all-seasons-for-a-show}{shows/:id/seasons/seasons}
user_profile() wraps endpoint \href{https://trakt.docs.apiary.io/#reference/seasons/summary/get-all-seasons-for-a-show}{shows/:id/seasons/seasons}
}
\usage{
seasons_summary(id, episodes = FALSE, drop_specials = TRUE,


+ 2
- 2
man/shows_next_episode.Rd View File

@ -5,9 +5,9 @@
\alias{shows_last_episode}
\title{Get a shows next or latest episode}
\source{
\href{https://trakt.docs.apiary.io/#reference/shows/next-episode/get-next-episode}{shows/:id/next_episode}
user_profile() wraps endpoint \href{https://trakt.docs.apiary.io/#reference/shows/next-episode/get-next-episode}{shows/:id/next_episode}
\href{https://trakt.docs.apiary.io/#reference/shows/last-episode/get-last-episode}{shows/:id/last_episode}
user_profile() wraps endpoint \href{https://trakt.docs.apiary.io/#reference/shows/last-episode/get-last-episode}{shows/:id/last_episode}
}
\usage{
shows_next_episode(id, extended = c("min", "full"))


+ 1
- 1
man/shows_related.Rd View File

@ -4,7 +4,7 @@
\alias{shows_related}
\title{Get similiar(ish) shows}
\source{
\href{https://trakt.docs.apiary.io/#reference/shows/related/get-related-shows}{shows/:id/related}
user_profile() wraps endpoint \href{https://trakt.docs.apiary.io/#reference/shows/related/get-related-shows}{shows/:id/related}
}
\usage{
shows_related(id, limit = 10L, extended = c("min", "full"))


+ 1
- 1
man/shows_summary.Rd View File

@ -4,7 +4,7 @@
\alias{shows_summary}
\title{Get a single show}
\source{
\href{https://trakt.docs.apiary.io/#reference/shows/summary/get-a-single-show}{shows/:id}
user_profile() wraps endpoint \href{https://trakt.docs.apiary.io/#reference/shows/summary/get-a-single-show}{shows/:id}
}
\usage{
shows_summary(id, extended = c("min", "full"))


+ 22
- 12
man/trakt_credentials.Rd View File

@ -4,38 +4,48 @@
\alias{trakt_credentials}
\title{Set the required trakt.tv API credentials}
\usage{
trakt_credentials(username, client_id, silent = TRUE)
trakt_credentials(username, client_id, client_secret, silent = TRUE)
}
\arguments{
\item{username}{\code{character(1)}: Explicitly set your trakt.tv username
(optional).}
\item{client_id}{\code{character(1)}: Explicitly set your API client ID
(required for API interaciton).}
(required for \emph{any} API interaction).}
\item{client_secret}{\code{character(1)}: Explicitly set your API client secret
(required only for \emph{authenticated} API interaction).}
\item{silent}{\code{logical(1) [TRUE]}: No messages are printed showing you the
API information.
Mostly for debug purposes.}
API information. Mostly for debug purposes.}
}
\value{
Nothing. Only messages.
Invisibly: A \code{list} with elements \code{username}, \code{client_id} and \code{client_secret},
where values are \code{TRUE} if the corresponding value is non-empty.
}
\description{
\code{trakt_credentials} searches for your credentials and stores them
in the appropriate \code{\link[=options]{options()}} variables of the same name.
in the appropriate \link[base:Sys.setenv]{environment variables} of the same name.
To make this work automatically, place your key as environment variables in
\code{~/.Renviron} (see \code{Details}).
Arguments to this function take precedence over any key file. To make API
functions work, you do not have to use this function unless you want to
supply your own client ID, which is recommended for larger data collection
projects.
Arguments to this function take precedence over any configuration file.
}
\details{
This function is called automatically when the package is loaded via \code{library(tRakt)}
or \code{tRakt::fun} function calls – you basically never have to use it if you have
stored your credentials as advised.
Additionally, for regular (non-authenticated) API interaction, you do not have to
set any credentials at all because the package's \code{client_secret} is used as a fallback,
which allows you to use most functions out of the box.
Set appropriate values in your \code{~/.Renviron} like this:\preformatted{# tRakt
trakt_username=jemus42
trakt_client_id=12[...]f2
trakt_client_secret=f23[...]2nkjb
}
If (and only if) the environment option \code{trakt_client_secret} is set to a non-empty
string (i.e. it's not \code{""}), then all requests will be made using authentication.
}
\examples{
\dontrun{
@ -45,8 +55,8 @@ trakt_credentials()
# Explicitly set values in an R session, overriding .Renviron values
trakt_credentials(
username = "sean",
client_id = "12fc1de7674[...]d5e11e3490823d629afdf2",
username = "jemus42",
client_id = "totallylegitclientsecret",
silent = FALSE
)
}


+ 1
- 5
man/trakt_get.Rd View File

@ -4,8 +4,7 @@
\alias{trakt_get}
\title{Make an API call and receive parsed output}
\usage{
trakt_get(url, client_id = getOption("trakt_client_id"), HEAD = FALSE,
auth = FALSE)
trakt_get(url, client_id = Sys.getenv("trakt_client_id"), HEAD = FALSE)
}
\arguments{
\item{url}{\code{character(1)}: The API endpoint. Either a full URL like
@ -20,9 +19,6 @@ further information.}
performed and its content returned. This is useful if you are only
interested in status codes or other headers, and don't want to waste
resources/bandwidth on the response body.}
\item{auth}{\code{logical(1) [FALSE]}: If \code{TRUE}, an authenticated request is made.
This requires a set client secret and manual interaction.}
}
\value{
The parsed (\code{\link[jsonlite:fromJSON]{jsonlite::fromJSON()}}) content of the API response.


+ 2
- 2
man/trending_media.Rd View File

@ -6,9 +6,9 @@
\alias{shows_trending}
\title{Trending media}
\source{
\href{https://trakt.docs.apiary.io/#reference/movies/trending/get-trending-movies}{movies/trending}
user_profile() wraps endpoint \href{https://trakt.docs.apiary.io/#reference/movies/trending/get-trending-movies}{movies/trending}
\href{https://trakt.docs.apiary.io/#reference/shows/trending/get-trending-shows}{shows/trending}
user_profile() wraps endpoint \href{https://trakt.docs.apiary.io/#reference/shows/trending/get-trending-shows}{shows/trending}
}
\usage{
movies_trending(limit = 10, extended = c("min", "full"),


+ 2
- 2
man/updated_media.Rd View File

@ -6,9 +6,9 @@
\alias{shows_updates}
\title{Recently updated media}
\source{
\href{https://trakt.docs.apiary.io/#reference/movies/updates/get-recently-updated-movies}{movies/updates/:start_date}
user_profile() wraps endpoint \href{https://trakt.docs.apiary.io/#reference/movies/updates/get-recently-updated-movies}{movies/updates/:start_date}
\href{https://trakt.docs.apiary.io/#reference/shows/updates/get-recently-updated-shows}{shows/updates/:start_date}
user_profile() wraps endpoint \href{https://trakt.docs.apiary.io/#reference/shows/updates/get-recently-updated-shows}{shows/updates/:start_date}
}
\usage{
movies_updates(limit = 10, extended = c("min", "full"),


+ 1
- 1
man/user_collection.Rd View File

@ -4,7 +4,7 @@
\alias{user_collection}
\title{Get a user's collected shows or movies}
\source{
\href{https://trakt.docs.apiary.io/#reference/users/collection/get-collection}{users/:id/collection/:type}
user_profile() wraps endpoint \href{https://trakt.docs.apiary.io/#reference/users/collection/get-collection}{users/:id/collection/:type}
}
\usage{
user_collection(user = getOption("trakt_username"), type = c("shows",


+ 2
- 1
man/user_comments.Rd View File

@ -4,7 +4,7 @@
\alias{user_comments}
\title{Get a user's comments}
\source{
\href{https://trakt.docs.apiary.io/#reference/users/comments/get-comments}{users/:id/comments/:comment_type/:type?include_replies=}
user_profile() wraps endpoint \href{https://trakt.docs.apiary.io/#reference/users/comments/get-comments}{users/:id/comments/:comment_type/:type?include_replies=}
}
\usage{
user_comments(user = getOption("trakt_username"),
@ -48,6 +48,7 @@ Other user data: \code{\link{user_collection}},
Other comment methods: \code{\link{comments_comment}},
\code{\link{comments_trending}},
\code{\link{comments_updates}},
\code{\link{media_comments}},
\code{\link{user_list_comments}}
}


+ 1
- 1
man/user_history.Rd View File

@ -4,7 +4,7 @@
\alias{user_history}
\title{Get a user's watch history}
\source{
\href{https://trakt.docs.apiary.io/#reference/users/history/get-watched-history}{users/:id/history/:type/:item_id?start_at=&end_at=}
user_profile() wraps endpoint \href{https://trakt.docs.apiary.io/#reference/users/history/get-watched-history}{users/:id/history/:type/:item_id?start_at=&end_at=}
}
\usage{
user_history(user = getOption("trakt_username"), type = c("shows",


+ 6
- 5
man/user_likes.Rd View File

@ -4,13 +4,13 @@
\alias{user_likes}
\title{Get items (comments, lists) a user likes}
\source{
\href{https://trakt.docs.apiary.io/#reference/users/likes/get-likes}{users/likes/:type}
user_profile() wraps endpoint \href{https://trakt.docs.apiary.io/#reference/users/likes/get-likes}{users/likes/:type} (Authentication required)
}
\usage{
user_likes(type = c("comments", "lists"))
}
\arguments{
\item{type}{One of "comments", "lists".}
\item{type}{\code{character(1) ["comments"]}: One of "comments", "lists".}
}
\value{
A \link[tibble:tibble-package]{tibble()}. If the function has a \code{limit} parameter
@ -18,11 +18,12 @@ A \link[tibble:tibble-package]{tibble()}. If the function has a \code{limit} par
If there are no results (or the API is unreachable), an empty \code{tibble()} is returned.
}
\description{
This requires authentication.
Get items (comments, lists) a user likes
}
\examples{
# Get liked lists
if (FALSE) {
# Get liked lists (only if there's a client secret set)
# See ?trakt_credentials
if (trakt_credentials()[["client_secret"]]) {
user_likes("lists")
}
}


+ 2
- 1
man/user_list_comments.Rd View File

@ -4,7 +4,7 @@
\alias{user_list_comments}
\title{Get comments on a user-created list}
\source{
\href{https://trakt.docs.apiary.io/#reference/users/list-comments/get-all-list-comments}{users/:id/lists/:list_id/comments/:sort}
user_profile() wraps endpoint \href{https://trakt.docs.apiary.io/#reference/users/list-comments/get-all-list-comments}{users/:id/lists/:list_id/comments/:sort}
}
\usage{
user_list_comments(user = getOption("trakt_username"), list_id,
@ -43,6 +43,7 @@ user_list_comments("donxy", "1248149")
\seealso{
Other comment methods: \code{\link{comments_comment}},
\code{\link{comments_trending}},
\code{\link{comments_updates}},
\code{\link{media_comments}}, \code{\link{user_comments}}
Other list methods: \code{\link{lists_popular}},


+ 1
- 1
man/user_list_items.Rd View File

@ -4,7 +4,7 @@
\alias{user_list_items}
\title{Get a user's list's items}
\source{
\href{https://trakt.docs.apiary.io/#reference/users/list-items/get-items-on-a-custom-list}{users/:id/lists/:list_id/items/:type}
user_profile() wraps endpoint \href{https://trakt.docs.apiary.io/#reference/users/list-items/get-items-on-a-custom-list}{users/:id/lists/:list_id/items/:type}
}
\usage{
user_list_items(user = getOption("trakt_username"), list_id,


+ 1
- 1
man/user_lists.Rd View File

@ -4,7 +4,7 @@
\alias{user_lists}
\title{Get a user's lists}
\source{
\href{https://trakt.docs.apiary.io/#reference/users/lists/get-a-user's-custom-lists}{users/:id/lists}
user_profile() wraps endpoint \href{https://trakt.docs.apiary.io/#reference/users/lists/get-a-user's-custom-lists}{users/:id/lists}
}
\usage{
user_lists(user = getOption("trakt_username"), extended = c("min",


+ 3
- 3
man/user_network.Rd View File

@ -7,11 +7,11 @@
\alias{user_friends}
\title{Get a user's social connections}
\source{
\href{https://trakt.docs.apiary.io/#reference/users/followers/get-followers}{users/:id/followers}
user_profile() wraps endpoint \href{https://trakt.docs.apiary.io/#reference/users/followers/get-followers}{users/:id/followers}
\href{https://trakt.docs.apiary.io/#reference/users/following/get-following}{users/:id/following}
user_profile() wraps endpoint \href{https://trakt.docs.apiary.io/#reference/users/following/get-following}{users/:id/following}
\href{https://trakt.docs.apiary.io/#reference/users/friends/get-friends}{users/:id/friends}
user_profile() wraps endpoint \href{https://trakt.docs.apiary.io/#reference/users/friends/get-friends}{users/:id/friends}
}
\usage{
user_followers(user = getOption("trakt_user"), extended = "min")


+ 1
- 1
man/user_profile.Rd View File

@ -4,7 +4,7 @@
\alias{user_profile}
\title{Get a user's profile}
\source{
\href{https://trakt.docs.apiary.io/#reference/users/profile/get-user-profile}{users/:id}
user_profile() wraps endpoint \href{https://trakt.docs.apiary.io/#reference/users/profile/get-user-profile}{users/:id}
}
\usage{
user_profile(user = getOption("trakt_username"), extended = c("min",


+ 1
- 1
man/user_ratings.Rd View File

@ -4,7 +4,7 @@
\alias{user_ratings}
\title{Get a user's ratings}
\source{
\href{https://trakt.docs.apiary.io/#reference/users/ratings/get-ratings}{users/:id/ratings/:type/:rating}
user_profile() wraps endpoint \href{https://trakt.docs.apiary.io/#reference/users/ratings/get-ratings}{users/:id/ratings/:type/:rating}
}
\usage{
user_ratings(user = getOption("trakt_username"), type = c("movies",


+ 1
- 1
man/user_stats.Rd View File

@ -5,7 +5,7 @@
\title{Returns stats about the movies, shows, and episodes a user has watched,
collected, and rated.}
\source{
\href{https://trakt.docs.apiary.io/#reference/users/stats/get-stats}{users/:id/stats}
user_profile() wraps endpoint \href{https://trakt.docs.apiary.io/#reference/users/stats/get-stats}{users/:id/stats}
}
\usage{
user_stats(user = getOption("trakt_username"))


+ 1
- 1
man/user_watched.Rd View File

@ -4,7 +4,7 @@
\alias{user_watched}
\title{Get a user's watched shows or movies}
\source{
\href{https://trakt.docs.apiary.io/#reference/users/watched/get-watched}{users/:id/watched/:type}
user_profile() wraps endpoint \href{https://trakt.docs.apiary.io/#reference/users/watched/get-watched}{users/:id/watched/:type}
}
\usage{
user_watched(user = getOption("trakt_username"), type = c("shows",


+ 1
- 1
man/user_watchlist.Rd View File

@ -4,7 +4,7 @@
\alias{user_watchlist}
\title{Get a user's watchlist}
\source{
\href{https://trakt.docs.apiary.io/#reference/users/watchlist/get-watchlist}{users/:id/watchlist/:type}
user_profile() wraps endpoint \href{https://trakt.docs.apiary.io/#reference/users/watchlist/get-watchlist}{users/:id/watchlist/:type}
}
\usage{
user_watchlist(user = getOption("trakt_username"), type = c("movies",


+ 2
- 2
man/watched_media.Rd View File

@ -6,9 +6,9 @@
\alias{shows_watched}
\title{Most watched media}
\source{
\href{https://trakt.docs.apiary.io/#reference/movies/watched/get-the-most-watched-movies}{movies/watched/:period}
user_profile() wraps endpoint \href{https://trakt.docs.apiary.io/#reference/movies/watched/get-the-most-watched-movies}{movies/watched/:period}
\href{https://trakt.docs.apiary.io/#reference/shows/watched/get-the-most-watched-shows}{shows/watched/:period}
user_profile() wraps endpoint \href{https://trakt.docs.apiary.io/#reference/shows/watched/get-the-most-watched-shows}{shows/watched/:period}
}
\usage{
movies_watched(limit = 10, extended = c("min", "full"),


Loading…
Cancel
Save