Last active
July 13, 2019 06:07
-
-
Save alstat/9656597 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(RCurl) | |
# Set SSL certs globally | |
options(RCurlOptions = list(cainfo = system.file("CurlSSL", "cacert.pem", package = "RCurl"))) | |
library(twitteR) | |
reqURL <- "https://api.twitter.com/oauth/request_token" | |
accessURL <- "https://api.twitter.com/oauth/access_token" | |
authURL <- "https://api.twitter.com/oauth/authorize" | |
apiKey <- "xxxxxxxxxxxxxxxxxxxxxx" | |
apiSecret <- "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" | |
twitCred <- OAuthFactory$new( | |
consumerKey = apiKey, | |
consumerSecret = apiSecret, | |
requestURL = reqURL, | |
accessURL = accessURL, | |
authURL = authURL | |
) | |
twitCred$handshake( | |
cainfo = system.file("CurlSSL", "cacert.pem", package = "RCurl") | |
) | |
registerTwitterOAuth(twitCred) |
Have the same problem on Mac OS 10.7.5. Can't fix it. Does anybody knows what could we do?
I came up with this and it worked :
library(twitteR)
library(ROAuth)
require(RCurl)
After you fire that off it will launch a browser with a PIN, then it will ask you to input your PIN into the app. At which point you may ask yourself where in my app do I enter this PIN?
There seems to be a new way to do this now, the above ways didn't work for me.
library(ROAuth)
apiKey <- "#####"
apiSecret <- "####"
actoken <- "#####"
acsecret <- "#####"
setup_twitter_oauth(
apiKey ,
apiSecret,
actoken,
acsecret
)
After that is done you'll have direct access. More straightforward IMO.
install.packages("twitteR")
install.packages("ROAuth")
library(twitteR)
library(ROAuth)
require(RCurl)
Thanks sickopath, your solution (and mis6036) worked perfectly.
Thanks mis6306, Solution working good !!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am using the following version of R ([64-bit] C:\Program Files\R\R-3.0.2) and running Windows 7 Enterprise on my laptop. I am new to R and attempting to conduct sentiment analysis instead of using IBM Modeler 16.0. I am tried to get the handshake to work for 2-days now and I keep getting error messages such as this. "Error: object 'OAuthFactory' not found "
when adding the code below
twitCred <- OAuthFactory$new(
Do you have any suggestions?