get_wiki: Get wiki pages for a specified subreddit.

Description Usage Arguments Details Value See Also Examples

Description

Get wiki pages for a specified subreddit.

Usage

1
2
3
4
5
6
7
8
get_wiki(
  subreddit,
  page = "all",
  accesstoken,
  output = c("df", "json", "all"),
  verbose = FALSE,
  retry = FALSE
)

Arguments

subreddit

Name of the subreddit for which wiki pages are requested.

page

Name of the requested page. If "page" is "all", all wiki pages for the subreddit are returned.

accesstoken

The access token required to access the endpoint. Scope of the access token must be "wikiread".

output

What the function should return. Choose json for an unparsed json object, df for a parsed object in form of a dataframe, and all for a list containg the json object, a dataframe, and the before and after anchors (if those exist for the endpoint).

verbose

A logical flag whether information about the data extraction should be printed to the console.

retry

A logical flag whether a failed api request should be retried. Requests will be tried up to three times with varying time intervals between requests.

Details

More info at https://www.reddit.com/dev/api/ and https://www.reddit.com/wiki/wiki

Value

The text of the wiki page and all revisions as a dataframe, json object or a list containing both. If "page" is "all", the names of all wiki pages as a dataframe, json object or a list containing both.

See Also

get_subreddit_info

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
## Not run: 
wiki_token <- get_token(scope = "wikiread",
                        useragent = my_useragent,
                        username = my_username,
                        password = my_password,
                        client_id = my_client_id,
                        client_secret = my_client_secret)

#All wiki pages of a subreddit
soccer_wiki <- get_wiki(subreddit = "soccer",
                       page = "all",
                       accesstoken = wiki_token)

#Access a specific wiki page
soccer_wiki_page <- get_wiki(subreddit = "soccer",
                            page = soccer_wiki[1,1],
                            accesstoken = wiki_token)

## End(Not run)

jfeldhege/redditoR documentation built on April 2, 2020, 9:42 p.m.