Get ROAuth to work on Windows 7

March 10, 2012

(This article was first published on Gage Theory » R, and kindly contributed to R-bloggers)

Jeff Gentry has created a couple of really fun and handy R packages for working with Twitter data called twitteR and ROAuth. He’s also written an easy to read vignette on how to get started. As of right now (March 1st, 2012) the current version of ROAuth, version 0.9.1, has some issues with running on Windows 7 that he’s aware of.

If you’re running into error messages like “SSL certificate problem, verify that the CA cert is OK” or “Invalid response from site, please check your consumerKey and consumerSecret and try again” – fear not, there are workarounds.

If you’re a Windows 7 user the first thing to do is go back to the 0.9.0 version of ROAuth. You can download the tarball from the CRAN archive and compile it from inside R:

install.packages("ROAuth_0.9.0.tar.gz", repos = NULL, type="source")

Once you’ve gotten to the credentials step in the vignette there’s 1 more little twist to add. In order to get the handshake to work properly we have to tell OAuth where the cacert.pem file (a public key certificate file) is in order to verify that we’re communicating with the real Twitter website:

credentials$handshake(cainfo = system.file("CurlSSL", "cacert.pem", package = "RCurl"))

The same is also true for any of the “get” methods like getUser() or getFollowers() that require OAuth. For example:

getUser('User', cainfo = system.file("CurlSSL", "cacert.pem", package = "RCurl"))

Until Jeff gets a chance to make any updates, this should be able to get you back up and running with his wonderful tool. Good luck!

To leave a comment for the author, please follow the link and comment on their blog: Gage Theory » R. offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...

If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.

Search R-bloggers


Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)