Description Usage Arguments Value Examples
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.
1 | import_reddit_content_from_url(url, timeout = 10)
|
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. |
A data.frame with data available from the provided url
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.