Questions tagged [rtweet]

Questions about the R package for interacting with Twitter's API

An implementation of calls designed to extract and organize Twitter data via Twitter’s REST and stream API’s. Functions formulate GET and POST requests and convert response objects to more user friendly structures, e.g., data frames or lists. Specific consideration is given to functions designed to return tweets data from searches, streams, and timelines and user ids from friends and followers lists. More info: rtwitter reference manual.

198 questions
7
votes
1 answer

R Authentication error when looping search_tweets function (rtweet package) over vector of Twitter handles

I've created a loop that runs through a vector of Twitter handles, and collects tweets from them using the search_tweets function from the rtweet package. Downloading the latest version of rtweet ## install devtools package if it's not already if…
Varun
  • 1,211
  • 1
  • 14
  • 31
5
votes
1 answer

How to embed tweets in R markdown documents being knit to HTML?

It is fairly easy to embed tweets into blog post using the blogdown R package and Hugo shortcodes as described at https://bookdown.org/yihui/blogdown/content.html. I would like to embed tweets in an R markdown document that is being knit to a…
alexpghayes
  • 673
  • 5
  • 17
4
votes
0 answers

Obtaining twitter screen names from a list of twitter ids?

I am trying to get the screen_names of the 8,000,000 followers of an account (WHO). To get followers of the account I use get_followers from rtweet package: who_flw <- get_followers("who", n = 8000000, retryonratelimit = TRUE) To turn user IDs of…
Iman
  • 71
  • 2
4
votes
1 answer

Get coordinates of country location using lookup_coords() function from rtweet package

I have installed rtweet and when I want to collect tweets from a specific country other than USA, the package doesn´t collect any data. I have already installed the Geocoding API, Maps JavaScript API and the Geolocation API with the same API key…
4
votes
1 answer

R – Using a loop on a list of Twitter handles to extract tweets and create multiple data frames

I’ve got a df that consists of Twitter handles that I wish to scrape on a regular basis. df=data.frame(twitter_handles=c("@katyperry","@justinbieber","@Cristiano","@BarackObama")) My Methodology I would like to run a for loop that loops over each…
Varun
  • 1,211
  • 1
  • 14
  • 31
3
votes
0 answers

Error in readRDS(x) : error reading from connection

I'm using rtweet package with the following commands: library(rtweet) hrc <- search_tweets(q = "hillaryclinton", n = 100) Error in readRDS(x) : error reading from connection Error in readRDS(x) : error reading from connection Wondering how to…
MYaseen208
  • 22,666
  • 37
  • 165
  • 309
3
votes
0 answers

rtweet to scrape a whole thread of a twitter status?

I am trying to use R to scrape the whole conversation thread of a twitter status. I am exploring rtweet, which is the latest package for extracting twitter data in R. I could not not find any. I wonder if anybody could help Thanks
2
votes
1 answer

Get the text in the image description of a tweet using rtweet

Is there a way to get the text used as the image description of tweets? I'm using the package, which allows one to get several pieces of information about a tweet (text, links, hashtags etc) but I can't get this info. {rtweet} allows one to post a…
rafa.pereira
  • 13,251
  • 6
  • 71
  • 109
2
votes
0 answers

Twitter API v1.1 update_profile_banner from within R

I want to update my Twitter banner profle (the header image) using the Twitter API v1.1 from within R. I don’t care how it’s done, it can be a function from an existing R package (the ones I know of, do not have this kind of functionality) or it can…
TimTeaFan
  • 17,549
  • 4
  • 18
  • 39
2
votes
0 answers

Error code when using Rtweet page: Permission denied when I try to load the Jason file from Twitter into R studio

new R user here and I stuck on this exercise. So I am trying to get tweets from twitter using the rtweet package and then create a data frame. I have installed the rtweet deleted and re-installed tidyverse. Loaded the it in the library, still I keep…
KECHY
  • 23
  • 3
2
votes
0 answers

Rtweet package for R authentication: error 401

I'm having difficulty using the Rtweet package. I've already got twitter API approval and my R script is not working the function: twitter_token <- create_token(app = appname, consumer_key = key, consumer_secret = secret) This message always…
2
votes
2 answers

Combine nest() and aggregate() in R?

Looking for some help and advice: I harvested tweets with the rtweet package. That got me a data frame with the observations (i.e. tweets) in the rows and the variables as columns. Variables are both on the tweet level (e.g. text, likes, hashtags…
2
votes
1 answer

rtweet - multiple AND/OR keyword search

I am using the rtweet package to retrieve tweets that contain specific keywords. I know how to do an "and"/"or" match, but how to chain these together into one keyword query with multiple OR/and conditions . For example, a search query I may wish to…
dano_
  • 303
  • 1
  • 8
2
votes
1 answer

How to create an edge list for each user mentioned in a tweet when there are observations containing several user mentioned

I want to do an network analysis of the tweets of some users of my interest and the mentioned users in their tweets. I retrieved the tweets (no retweets) from several user timelines using the rtweet package in r and want to see who they mention in…
Laura
  • 35
  • 5
2
votes
1 answer

Downloading stops using the "search_tweets"-function of the "rtweet"-library

I'm trying to use the rtweet-package to download some tweets from a certain hashtag. I've used a guide from a place called OpenCodez, and I've run into problems Using the "search_tweets" function of the rtweet-package, I'm not able to download more…
TheRecruit
  • 184
  • 9
1
2 3
13 14