mkearney / tweetbotornot

🤖 R package for detecting Twitter bots via machine learning
https://tweetbotornot.mikewk.com
Other
388 stars 136 forks source link

Example code doesn't run #9

Open bmewing opened 6 years ago

bmewing commented 6 years ago

When following the example code on the repo, I get an error with the line data <- botornot(users)

Error in init_oauth1.0(self$endpoint, self$app, permission = self$params$permission, : Unauthorized (HTTP 401).

Do I need to be providing info to rtweet? If so, would be good to modify the example.

mkearney commented 6 years ago

Yeah. A recent change initiated by Twitter now requires the creation of a Twitter token to make API requests via rtweet. There are instructions here: http://rtweet.info/articles/auth.html. I've been meaninng to fix this so it'd only be a matter of authorizing an app to send requests on behalf of your Twitter account, but haven't gotten around to it yet.

john-guerra commented 6 years ago

Thanks for doing this library @mkearney. I'm also having issues even with the demo that doesn't use rtweet, just wanted to report it and thank you for your work

mkearney commented 6 years ago

botornot uses rtweet under the hood. So you'll have to register and app through Twitter and save the token–a fairly quick and easy process outlines step-by-step here: http://rtweet.info/articles/auth.html.

john-guerra commented 6 years ago

I have managed to do that, after install httpuv, maybe it would be a good idea to add those as pre-requisites for installation.

Thanks again for making this.

I'm testing it for Spanish speaking bots and it has been working mostly fine, I'm wondering if the model is applicable on Spanish. Any thoughts?

channabasavagola-zz commented 6 years ago

Hello Michael,

How to solve this issue?

Error: 'join_rtweet' is not an exported object from 'namespace:rtweet' .

There are StackOverflow articles suggesting me to user ::: instead of ::. It will also be helpful to know if you have written a research paper or cited any!

Thanks, Channa

mkearney commented 6 years ago

@john-guerra it's fairly agnostic about language. But I'd like to add more features based on lang soon.

@channabasavagola can you install latest version of rtweet and botrnot? I'm actively developing both in preparation for official CRAN releases in next few weeks. I believe the newest versions should work fine and resolve that bug, but if you install new and they still don't work let me know!

devtools::install_github("mkearney/rtweet")
devtools::install_github("mkearney/botrnot")
jeblyson commented 6 years ago

Unfortunately I've set up the application and callback URL as in the demo, but I'm still receiving this error when I try to create the token.

Error in init_oauth1.0(self$endpoint, self$app, permission = self$params$permission,  : 
  Unauthorized (HTTP 401).

I've seen I can also create the token on Twitter separately - is there any possibility for using that and just passing access tokens Twitter gives me as a variable to verify with rtweet?

Thanks, looking very much forward to getting set up and using this great package