Created
May 1, 2013 18:11
-
-
Save mjhea0/5497065 to your computer and use it in GitHub Desktop.
Sentiment Analysis via R
This file contains hidden or 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
| Create an app on https://dev.twitter.com/, make sure you leave Callback URL blank (so that it will return to a page where twitter shows you a PIN, useful during twitCred$handshake below. Don't worry yet, read on.) | |
| Run these on R (on separate lines): | |
| reqURL <- "https://api.twitter.com/oauth/request_token" | |
| accessURL <- "http://api.twitter.com/oauth/access_token" | |
| authURL <- "http://api.twitter.com/oauth/authorize" | |
| consumerKey <- "yourconsumerkey" | |
| consumerSecret <- "yourconsumersecret" | |
| twitCred <- OAuthFactory$new(consumerKey=consumerKey,consumerSecret=consumerSecret,requestURL=reqURL,accessURL=accessURL,authURL=authURL) | |
| download.file(url="http://curl.haxx.se/ca/cacert.pem", destfile="cacert.pem") | |
| twitCred$handshake(cainfo="cacert.pem") | |
| registerTwitterOAuth(twitCred) | |
| And make sure you specify the PEM cert when calling the searchTwitter method: | |
| tweets = searchTwitter("#abortion", n=200, cainfo="cacert.pem") |
setup_twitter_oauth(consumer_key=consumerkey, consumer_secret=consumerSecret, access_token=accessToken, access_secret=accessSecret)
[1] "Using direct authentication"
Error in check_twitter_oauth() : OAuth authentication error:
This most likely means that you have incorrectly called setup_twitter_oauth()'
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
can u give the java code