post_api: Post Reddit API function

Description Usage Arguments Value Note Examples

Description

Simple helper function to use any API function requring a POST method

Usage

1
post_api(url, params, token)

Arguments

url

URL of the API function

params

A list of parameters to feed the API function

token

oAuth token created by reddit_login() function

Value

Json object

Note

See http://www.reddit.com/dev/api/ for list of functions and required paramters for each API function

Examples

1
2
3
4
5
# Post a comment to a thread
api_url <- "https://oauth.reddit.com/api/comment"
plist   <- list(text = "Hi Mom", thing_id = "t3_2is85o", api_type = "json")

post_api(url = api_url, params = plist, token = rtoken)

ndiquattro/redditR documentation built on May 23, 2019, 1:28 p.m.