Skip to contents

Get a single comment

Usage

comments_comment(id, extended = c("min", "full"))

comments_replies(id, extended = c("min", "full"))

comments_likes(id, extended = c("min", "full"))

comments_item(id, extended = c("min", "full"))

Source

comments_comment() wraps endpoint comments/:id.

comments_replies() wraps endpoint comments/:id/replies.

comments_likes() wraps endpoint comments/:id/likes.

comments_item() wraps endpoint comments/:id/item.

Arguments

id

character(1): The ID of the item requested. Preferably the trakt ID (e.g. 1429). Other options are the trakt.tv slug (e.g. "the-wire") or imdb ID (e.g. "tt0306414"). Can also be of length greater than 1, in which case the function is called on all id values separately and the result is combined. See vignette("finding-things") for more details.

extended

character(1): Either "min" (API default) or "full". The latter returns more variables and should generally only be used if required. See vignette("finding-things") for more details.

Value

A tibble(). If the function has a limit parameter (defaulting to 10), this will be the (maximum) number of rows of the tibble. If there are no results (or the API is unreachable), an empty tibble() is returned.

Functions

  • comments_replies(): Get a comment's replies

  • comments_likes(): Get users who liked a comment.

  • comments_item(): Get the media item attached to the comment.

Examples

# A single comment
comments_comment("236397")
#> # A tibble: 1 × 16
#>       id comment                    spoiler review parent_id created_at         
#>    <int> <chr>                      <lgl>   <lgl>      <int> <dttm>             
#> 1 236397 All the gun inflicted dea… FALSE   FALSE          0 2019-06-09 21:33:00
#> # ℹ 10 more variables: updated_at <dttm>, replies <int>, likes <int>,
#> #   user_rating <int>, username <chr>, private <lgl>, user_name <chr>,
#> #   vip <lgl>, vip_ep <lgl>, user_slug <chr>

# Multiple comments
comments_comment(c("236397", "112561"))
#> # A tibble: 2 × 16
#>       id comment                    spoiler review parent_id created_at         
#>    <int> <chr>                      <lgl>   <lgl>      <int> <dttm>             
#> 1 236397 All the gun inflicted dea… FALSE   FALSE          0 2019-06-09 21:33:00
#> 2 112561 Seriously though what the… FALSE   FALSE          0 2017-01-31 17:48:59
#> # ℹ 10 more variables: updated_at <dttm>, replies <int>, likes <int>,
#> #   user_rating <int>, username <chr>, private <lgl>, user_name <chr>,
#> #   vip <lgl>, vip_ep <lgl>, user_slug <chr>
if (FALSE) {
comments_replies("236397")
}
if (FALSE) {
comments_likes("236397")
}
if (FALSE) {
# A movie
comments_item("236397")
comments_item("236397", extended = "full")

# A show
comments_item("120768")
comments_item("120768", extended = "full")

# A season
comments_item("140265")
comments_item("140265", extended = "full")

# An episode
comments_item("136632")
comments_item("136632", extended = "full")
}