tags:

views:

275

answers:

2
+9  Q: 

OAuth access for R

I'm trying to use R to grab some web data that requires OAuth authentication. Searching on CRAN and RSeek.org for info on OAuth + R provides nothing. Any tips for accessing RESTful APIs with R using OAuth?

I'm considering using some Python/Perl/Ruby to grab the data, save it to a text file, then work on it with R. I'd prefer to stay totally in R, but it seems like OAuth is a barrier.

+1  A: 

One option I stumbled on is called OAuth Proxy and it slips the OAuth headers in using a proxy. This is an interesting kludge.

JD Long
+1  A: 

Another possible, assuming you have access to the required crypto functions in R, you can implement OAuth completely as HTTP requests without any lib support etc.

While writing a complete oauth lib might be asking too much, if you just need a quick and dirty way to pull down data, it shouldn't be too difficult to hand craft the few functions you need to complete an oauth request.

Also, while R may not have an oauth lib, most of the difficult part of oauth is in the interaction between servers, not in creating the tokens/requests, so you should be able to look at another language's implementation and port the required logic to R. I would suggest looking at a simple lib from http://oauth.net/code/ for a starting point.

Brandon C