Skip to content
This repository was archived by the owner on Mar 25, 2020. It is now read-only.

Basic Usage

Tom Wilson edited this page Apr 20, 2017 · 5 revisions

When the fatsecretR library is loaded, a fatsecret (S4) object will be assigned into the global environment. This object helps to manage essential parameters when making API requests.

> library(fatsecretR)
> ls()
[1] "fatsecret"

> class(fatsecret)
[1] "fatsecret"
attr(,"package")
[1] "fatsecretR"

> slotNames(fatsecret)
[1] "ConsumerKey"     "SharedSecret"    "oauthConsumer"   "RESTURL"        
[5] "httpMethod"      "signatureMethod" "oauthVersion"    "timestamp"      
[9] "nonce"

The object show method will inform you if API keys have been added and when the object was last 'Timestamped' and thus; used in an API request.

> fatsecret

fatsecret S4 object 
 
For more details, please visit https://github.com/wilsontom/fatsecretR/wiki 
 
No API ConsumerKey has been added yet
 
No API SharedSecret has been added yet
 
Last timestamp: 
no timestamp available

Your API keys can be then be added to the object;

APIkeys(fatsecret, token = "api_token", secret = "api_secret")

Clone this wiki locally