Description Usage Arguments Details Value Examples
Generate an access token for the Reddit API
1 2 3 4 5 6 7 8 |
scope |
The scope of what you want to access. Must be one of these: identity, read, history, wikiread |
useragent |
The useragent for the device accessing the API |
username |
Username for the Reddit profile accessing the API. If left
empty, it will attempt to read from the environment. Can be set with
|
password |
Password for the Reddit profile accessing the API. If left
empty, it will attempt to read from the environment. Can be set with
|
client_id |
The id of the app through which the API is accessed.If left
empty, it will attempt to read from the environment. Can be set with
|
client_secret |
The client secret of the app through which the API is
accessed. If left empty, it will attempt to read from the environment. Can be
set with |
Access tokens are recquired to acccess any of the endpoints of the API. Access tokens are only valid for an hour. It is recquired to define an App through which the API is being accessed. Apps can be defined in the settings at this page https://www.reddit.com/prefs/apps/. Client ID and Client Secret must be taken from this page. More info about accessing the API at https://www.reddit.com/dev/api/
More info at https://www.reddit.com/dev/api/
A list containing the access token, the time until it expires, the scope, the time it was generated and the useragent
A list containing the access token, its scope, the acces time and the useragent.
1 2 3 4 5 6 7 8 9 | ## Not run:
read_token <- get_token(scope = "read",
useragent = useragent,
username = username,
password = password,
client_id = client_id,
client_secret = client_secret)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.