How to get Twitter mentions id using academictwitteR package?

Viewed 19

I am trying to create several network analyses from Twitter. To get the data, I used the academictwitteR package and their get_all_tweets command.

  get_all_tweets(
    users = c("LegaSalvini"),
    start_tweets = "2007-01-01T00:00:00Z", 
    end_tweets = "2022-07-01T00:00:00Z",
    file = "tweets_lega",
    data_path = "tweetslega/",
    bind_tweets = FALSE
  )


## Binding JSON files into data.frame objects
tweets_bind_lega <- bind_tweets(data_path = "tweetslega/")

##Tyding
tweets_bind_lega_tidy <- bind_tweets(data_path = "tweetslega/", output_format = "tidy")

With this, I can easily access the ids for the creation of a retweet and reply network. However, the tidy format does not provide a tidy column for the mentions, instead it deletes them.

However, they are in my untidy df tweets_bind_lega , but stored as a list tweets_bind_afd$entities$mentions. Now I would like to somehow unnest this list and create a tidy df with a column that has contains the mentioned Twitter user ids.

Has anyone created a mention network with academictwitteR before and can help me out? Thanks!

0 Answers
Related