Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error reading from connection #20

Open
ElenaCorriero opened this issue Oct 4, 2018 · 7 comments
Open

Error reading from connection #20

ElenaCorriero opened this issue Oct 4, 2018 · 7 comments

Comments

@ElenaCorriero
Copy link

I've downloaded the package and attempted to run it on a vector of usernames, but I get an error result:

Error in readRDS(x) : error reading from connection

@mkearney
Copy link
Owner

mkearney commented Oct 4, 2018

Can you include the code you used? This error is typically due to an incorrect path passed to readRDS(), which would have to be from either (a) when you read in your vector of screen names or (b) when rtweet tried to read your token.

W/o more code to replicate, my advice is to install the newest version of rtweet

## install newest version of rtweet
install.packages("rtweet")

Check to make sure it's at least version 0.6.8

packageVersion("rtweet")
[1] '0.6.8'

Then, to make sure rtweet gets configured correctly, wipe any TWITTER_PAT environment variables and do a quick search:

## wipe twitter_pat env var
Sys.setenv(TWITTER_PAT = "")

## search via rtweet
rt <- rtweet::search_tweets("lang:en")

That should pop-up a window asking you to authorize the rstats2twitter (rtweet) client, which will enable rtweet to send API requests on your behalf (which {{tweetbotornot}} uses to gather data it needs to generate estimate)

@ElenaCorriero
Copy link
Author

ElenaCorriero commented Oct 5, 2018 via email

@sevetseh28
Copy link

sevetseh28 commented Oct 25, 2018

Im getting the same error:

Error in textfeatures::textfeatures(x, normalize = FALSE, word_dims = 0) :
unused arguments (normalize = FALSE, word_dims = 0)

Any idea @mkearney ?

@sevetseh28
Copy link

btw im using 3.5.1 version of R

@sevetseh28
Copy link

I will report this on another issue since it's another problem and seems to be recent.

@Hawkeye407
Copy link

Hawkeye407 commented Nov 3, 2018

Hi, I have the same problem:
tweetbotornot("realdonaldtrump")
Error in readRDS(x) : error reading from connection

I thing this isn't problem with token. For userTimeline() function I have good results:

userTimeline("realdonaldtrump", n = 10)
[[1]]
[1] "realDonaldTrump: If Chuck Schumer and Nancy Pelosi gain the majority, they will try to raise your taxes, restore job-killing regulat… https://t.co/Oz37oGMsT6"
...

R version 3.5.1 (2018-07-02) -- "Feather Spray"
Platform: x86_64-w64-mingw32/x64 (64-bit)

@mkearney

@Hawkeye407
Copy link

Hi guys,
today I solved the problem. I used different authorization which not work with this package.
Before I used:

consumer_key <- "xxxxxxxxxxxxxxxxxxxx"
consumer_secret <-"xxxxxxxxxxxxxxxxxx"
access_token <-"xxxxxxxxxxxxxxxxx"
access_secret <- "xxxxxxxxxxxxxx"
setup_twitter_oauth(consumer_key, consumer_secret, access_token, access_secret)

It's work for twitterR package.

But for tweetbotornot you must use:

if (!requireNamespace("httpuv", quietly = TRUE)) {
install.packages("httpuv")
}
token <- create_token(
app = "best_app_for_mining",
consumer_key = "xxxxxxxxxxxxxxxxxxxx",
consumer_secret = "xxxxxxxxxxxxxxxx")

identical(twitter_token, get_token())

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants