Skip to content

Commit

Permalink
fix doc issues
Browse files Browse the repository at this point in the history
  • Loading branch information
JBGruber committed Nov 1, 2024
1 parent 801bac7 commit 7f628bc
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 11 deletions.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,4 @@ export(tt_user_videos_api)
export(tt_user_videos_hidden)
export(tt_videos)
export(tt_videos_hidden)
importFrom(rlang,.data)
1 change: 0 additions & 1 deletion R/api_research.r
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,6 @@ tt_user_request <- function(endpoint,
#' @description \ifelse{html}{\figure{api-research.svg}{options: alt='[Works on:
#' Research API]'}}{\strong{[Works on: Research API]}}
#'
#' @param ... additional arguments handed to \link{tt_search_api}.
#' @inheritParams tt_user_liked_videos_api
#'
#' @return A data.frame of parsed TikTok videos the user has posted
Expand Down
11 changes: 9 additions & 2 deletions R/api_research_extended.r
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,22 @@
#' \link{tt_user_videos_hidden} for the unofficial API version.
#'
#' @param username The username or usernames whose videos you want to retrieve.
#' @param since limit from when on to go through the account in 30 day windows.
#' @param ... Additional arguments to be passed to the
#' \code{\link{tt_search_api}} function.
#'
#' @inheritParams tt_search_api
#'
#' @examples
#' \dontrun{
#' # Get hidden videos from the user "fpoe_at"
#' tt_user_videos_api("fpoe_at")
#' # Get videos from the user "fpoe_at" since October 2024
#' tt_user_videos_api("fpoe_at", since = "2024-10-01")
#'
#' # often makes sense to combine this with the account creation time from the
#' # hidden URL
#' fpoe_at_info <- tt_user_info_hidden(username = "fpoe_at")
#' tt_user_videos_api("fpoe_at", since = fpoe_at_info$create_time)
#'
#' }
#' @export
tt_user_videos_api <- function(username,
Expand Down
9 changes: 5 additions & 4 deletions R/parse_hidden.r
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ parse_search <- function(res) {


#' @noRd
#' @importFrom rlang .data
parse_user <- function(user_data) {

user_info <- spluck(user_data, "__DEFAULT_SCOPE__", "webapp.user-detail", "userInfo")
Expand All @@ -171,10 +172,10 @@ parse_user <- function(user_data) {
purrr::list_flatten() |>
tibble::as_tibble(.name_repair = clean_names) |>
# for minimal backwards compatibility
dplyr::rename(user_name = unique_id,
secUid = sec_uid) |>
dplyr::mutate(create_time = as_datetime(create_time),
nick_name_modify_time = as_datetime(nick_name_modify_time))
dplyr::rename(user_name = .data$unique_id,
secUid = .data$sec_uid) |>
dplyr::mutate(create_time = as_datetime(.data$create_time),
nick_name_modify_time = as_datetime(.data$nick_name_modify_time))

}

Expand Down
2 changes: 0 additions & 2 deletions man/tt_user_info_api.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 10 additions & 2 deletions man/tt_user_videos_api.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7f628bc

Please sign in to comment.