- ## Not run:
- ## an example of an authenticated request after creating the OAuth token
- ## where app_id and app_secret are fictitious, and token is saved for
- ## future sessions
- fb_oauth <- fbOAuth(app_id="123456789", app_secret="1A2B3C4D")
- save(fb_oauth, file="fb_oauth")
- load("fb_oauth")
- me <- getUsers("me", token=fb_oauth)
- me$username
- ## an example of a request using a temporary access token
- token <- "XXXXXXAAAAAAA1111"
- me <- getUsers("me", token=token)
- ## End(Not run)
复制代码DescriptionfbOAuth creates a long-lived OAuth access token that enables R to make authenticated calls tothe Facebook API. The token can be saved as a file in disk to be re-used in future sessions. Thisfunction relies on the httr package to create the OAuth token, and is a simplified version of one ofits examples.This function will automatically detect the API version for the token you create.