Closed t-davidson closed 2 years ago
It seems like Twitter made some changes to the likes and retweets endpoints recently. This might be the reason for the issue: https://twittercommunity.com/t/updates-to-retweets-lookup-and-likes-lookup-endpoints/165327
@t-davidson Thanks for reporting this. I confirm that I can reproduce this. And I will look into your PR (Thanks also!)
require(academictwitteR)
#> Loading required package: academictwitteR
test <- get_all_tweets(user = c("uklabour"),
start_tweets = "2021-01-01T00:00:00Z",
end_tweets = "2022-01-01T00:00:00Z",
is_retweet = FALSE,
n = 100)
#> Warning: Recommended to specify a data path in order to mitigate data loss when
#> ingesting large amounts of data.
#> Warning: Tweets will not be stored as JSONs or as a .rds file and will only be
#> available in local memory if assigned to an object.
#> query: (from:uklabour) -is:retweet
#> Total pages queried: 1 (tweets captured this page: 499).
#> Total tweets captured now reach 100 : finishing collection.
likers <- get_liking_users(test$id[1], verbose = TRUE)
#> Processing 1476155918597373952
#> Total data points: 91
#> Total data points: 180
#> Total data points: 268
#> Total data points: 351
#> Total data points: 421
#> Total data points: 422
#> This is the last page for 1476155918597373952 : finishing collection.
retweeters <- get_retweeted_by(test$id[1], verbose = TRUE)
#> Processing 1476155918597373952
#> Total pages queried: 1 (tweets captured this page: 93).
#> Error in make_query(url = endpoint_url, params = params, bearer_token = bearer_token, : something went wrong. Status code: 400
Created on 2022-02-09 by the reprex package (v2.0.1)
Fixed by 5245710
Late to the party but thank you for this PR @t-davidson ! And thanks for adding unit tests @chainsawriot
Thanks @chainsawriot @cjbarrie for the quick response and integration of the PR - and for making and maintaining such a great package!
Please confirm the following
something went wrong. Status code: 400.
Describe the bug
I've been trying to use the
get_retweeted_by
function but keep getting 400 errors. The function runs for tweets without any retweets but returns a 400 error as soon as it processes the first batch of retweets on a tweet with one or more retweets.This is what the output looks like for the example below:
I have also been running the
get_liking_users
function and have had no problems, despite the identical syntax, so I'm confident there is not an error in my input. I have tried this on several different Twitter accounts, have restarted R multiple times, and have installed the latest version ofacademictwitteR
from Github. I get the same error every time.I looked at the source code for this function but nothing immediately jumps out to me. I would be interested to see if anyone else can reproduce the error.
Expected Behavior
The function should return a data frame containing a list of users who retweeted tweets in the supplied vector of tweet IDs.
Steps To Reproduce
The following code reproduces the error:
Environment
Anything else?
No response