@@ -76,7 +76,14 @@ search_user <- function(query,
7676}
7777
7878
79- # ' Query profile of an actor
79+ # ' Query profile of an actor or actors
80+ # '
81+ # ' @details
82+ # ' Note that if you query several actors at once, profiles that do not (longer)
83+ # ' exist will be missing from the results. If you query and individual actors
84+ # ' and the profile is missing, the API will return an error and a message like
85+ # ' "Account has been suspended".
86+ # '
8087# '
8188# ' @param actor user handle(s) to get information for.
8289# ' @inheritParams search_user
@@ -93,12 +100,17 @@ get_user_info <- function(actor,
93100parse = TRUE ,
94101.token = NULL ) {
95102
103+ fun <- app_bsky_actor_get_profile2
104+ if (length(actor )> 1 ) {
105+ fun <- app_bsky_actor_get_profiles
106+ }
107+
96108actor_l <- split(actor , ceiling(seq_along(actor )/ 25L ))
97109
98110res <- list ()
99111for (actor_i in actor_l ) {
100112res <- append(res , do.call(
101- what = app_bsky_actor_get_profiles ,
113+ what = fun ,
102114args = list (
103115actor_i ,
104116.token = .token ,
@@ -112,3 +124,16 @@ get_user_info <- function(actor,
112124 }
113125return (res )
114126}
127+
128+
129+ # app_bsky_actor_get_profile returns different format, making it harder to parse
130+ app_bsky_actor_get_profile2 <- function (actor ,.token = NULL ,.return = c(" json" ," resp" )) {
131+ list (profiles = list (make_request(
132+ name = " bsky.social/xrpc/app.bsky.actor.getProfile" ,
133+ params = as.list(match.call())[- 1 ]| >
134+ purrr :: imap(~ {
135+ eval(.x ,envir = parent.frame())
136+ }),
137+ req_method = " GET"
138+ )))
139+ }