View source: R/user_mendeley_auth.r
mendeley_auth | R Documentation |
User specific API methods require obtaining access keys
from Mendeley.com. To do so, first sign up at the Mendeley
developer site and
obtain Mendeley API keys. Ideally you should store these
keys in your .rprofile
like so:
options(MendeleyKey="Your_Key")
options(MendeleySecret="Your_secret_key")
If this is
not possible (assuming you are on a public machine), then
you can spefify both inline. Calling mendeley_auth()
with the right keys will launch your default browser and
take you to Mendeley.com to authorize this application. If
you are not logged in, you will first be prompted to login
with your Mendeley user/pass. Next, click accept to see a
pin. At that point, copy the pin and paste it back at the R
prompt. If you assign this to a R object, then you can use
that as the first argument in all functions that require
authentication. If you have successfully completed this
step, you should ideally save the Oauth credential
object
to disk for future use. There is no need to repeat
this step each time.
mendeley_auth(cKey = getOption("MendeleyKey", stop("Missing Mendeley consumer key")), cSecret = getOption("MendeleyPrivateKey", stop("Missing Mendeley app secret")), curl = getCurlHandle(), ...)
cKey |
Consumer key. can be supplied here or read from Options() |
cSecret |
Consumer secret. can be supplied here or read from Options() |
curl |
If using in a loop, call getCurlHandle() first and pass the returned value in here (avoids unnecessary footprint) |
... |
optional additional curl options (debugging tools mostly). |
OAUth credential.
Karthik Ram karthik.ram@gmail.com
## Not run: mc <- mendeley_auth('YOUR_CONSUMER_KEY', 'YOUR_CONSUMER_SECRET') mc <- mendeley_auth() # If your keys are stored in options using as MendeleyKey and MendeleyPrivateKey. ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.