Skip to content
This repository has been archived by the owner on Nov 10, 2024. It is now read-only.

Commit

Permalink
Commit everything before merge
Browse files Browse the repository at this point in the history
  • Loading branch information
llrs committed Dec 11, 2023
1 parent 7b7db9f commit 0d09ef1
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 20 deletions.
5 changes: 2 additions & 3 deletions R/auth.R
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,8 @@ ask_pass <- function(type) {
val
}

#' Generate a Bearer token from a client
#'
#' @export
#' @rdname rtweet_user
rtweet_bearer <- function(client = NULL, scopes = set_scopes()) {

client <- client %||% client_get()
Expand All @@ -200,7 +199,7 @@ rtweet_bearer <- function(client = NULL, scopes = set_scopes()) {
token
}

#' @seealso [invalidate_bearer()]
# @seealso [invalidate_bearer()]
rtweet_invalidate <- function(api_key, api_secret, token = NULL) {
if (missing(api_key)) {
api_key <- ask_pass("API key")
Expand Down
1 change: 0 additions & 1 deletion R/bearer_token.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ bearer_token <- function(token = NULL) {
#' @references <https://developer.twitter.com/en/docs/authentication/api-reference/invalidate_bearer_token>
#' <https://developer.twitter.com/en/docs/authentication/api-reference/invalidate_access_token>
#' @keywords internal
#' @seealso [rtweet_invalidate()]
#' @export
invalidate_bearer <- function(api_key, api_secret, client = NULL, token = NULL) {
# See also rtweet_invalidate in auth.R
Expand Down
4 changes: 2 additions & 2 deletions R/collections.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ lookup_collections <- function(id, n = 200,
parse = TRUE,
token = NULL,
...) {
lifecycle::deprecate_stop("1.0.0", "lookup_collections()")
lifecycle::deprecate_stop("1.0.0", function_call())
}

#' @export
Expand All @@ -24,5 +24,5 @@ get_collections <- function(user = NULL,
parse = TRUE,
token = NULL) {

lifecycle::deprecate_stop("1.0.0", "get_collections()")
lifecycle::deprecate_stop("1.0.0", function_call())
}
3 changes: 3 additions & 0 deletions R/http.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ TWIT_method <- function(method, token, api,
retryonratelimit = NULL,
verbose = TRUE,
...) {
lifecycle::deprecate_stop("2.0.0", function_caller(),
details = c("The removal of API v1.1 made this function obsolete.",
"See the new vignette about the new requirements and functions."))
# need scipen to ensure large IDs are not displayed in scientific notation
# need ut8-encoding for the comma separated IDs
withr::local_options(scipen = 14, encoding = "UTF-8")
Expand Down
2 changes: 2 additions & 0 deletions R/ts_plot.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#' @family ts_data
#' @export
ts_plot <- function(data, by = "days", trim = 0L, tz ="UTC", ...) {
lifecycle::deprecate_stop("2.0.0", function_call())
data <- ts_data(data, by, trim, tz)
check_installed("ggplot2")

Expand Down Expand Up @@ -79,6 +80,7 @@ ts_plot <- function(data, by = "days", trim = 0L, tz ="UTC", ...) {
#'
#' @export
ts_data <- function(data, by = "days", trim = 0L, tz ="UTC") {
lifecycle::deprecate_stop("2.0.0", function_call())
stopifnot(is.data.frame(data), is.atomic(by) && !is.null(by))
if (has_name_(data, "created_at")) {
dtvar <- "created_at"
Expand Down
9 changes: 9 additions & 0 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,12 @@ release_bullets <- function() {
"Check spelling with: `spelling::spell_check_package()`",
"Run manual tests.")
}


function_call <- function() {
paste0(as.character(sys.call(sys.parent(1)))[1L], "()")
}

function_caller <- function() {
paste0(as.character(sys.call(1))[1L], "()")
}
3 changes: 0 additions & 3 deletions man/invalidate_bearer.Rd

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

11 changes: 0 additions & 11 deletions man/rtweet_bearer.Rd

This file was deleted.

3 changes: 3 additions & 0 deletions man/rtweet_user.Rd

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

0 comments on commit 0d09ef1

Please sign in to comment.