import_reddit_content_from_url: Import Data from a Pushshift URL

Description Usage Arguments Value Examples

Description

This function is a wrapper around fromJSON that returns a data.frame instead of a list. This function is primarily useful for powering get_reddit_content, but can also be called directly on a single url obtained via construct_pushshift_url.

Usage

1

Arguments

url

A url leading to JSON data, typically produced via construct_pushshift_url.

timeout

An integer representing the maximum amount of time to allow for retrieving content from a single URL. Defaults to 10 seconds.

Value

A data.frame with data available from the provided url

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# read the 25 recent Reddit comments into R
import_reddit_content_from_url(construct_pushshift_url())

# construct a url using pushshift api parameters
comments_url <- construct_pushshift_url(
  content_type = "comment",
  q = "Stardew Valley",
  subreddit = "games"
)

# import data from that url
comments_df <- import_reddit_content_from_url(comments_url)

geoffwlamb/redditr documentation built on May 15, 2019, 11:41 a.m.