Type: Package
Title: 'Pushshift' API Wrapper for 'Reddit' Submission and Comment Search
Version: 0.1.0
Description: Connects to the API of https://pushshift.io/ to search for 'Reddit' comments and submissions.
URL: https://github.com/schochastics/PSAWR/
BugReports: https://github.com/schochastics/PSAWR/issues
License: MIT + file LICENSE
Encoding: UTF-8
LazyData: true
Depends: R (≥ 3.6)
Imports: dplyr, httr, tibble
RoxygenNote: 7.2.3
Suggests: covr, testthat (≥ 3.0.0), vcr (≥ 0.6.0)
Config/testthat/edition: 3
NeedsCompilation: no
Packaged: 2023-02-27 19:40:49 UTC; david
Author: David Schoch ORCID iD [aut, cre]
Maintainer: David Schoch <david@schochastics.net>
Repository: CRAN
Date/Publication: 2023-02-28 15:02:30 UTC

Pushshift.io parameters for all endpoints

Description

Pushshift.io parameters for all endpoints

Usage

ps_params

Format

tibble of Endpoint Paramters

Source

https://pushshift.io/api-parameters/


Search Pushshift.io for Reddit comments

Description

Search Pushshift.io for Reddit comments

Usage

search_comments(
  q = "",
  subreddit = NULL,
  size = 25,
  after = NULL,
  before = NULL,
  parse_date = TRUE,
  verbose = TRUE,
  ...
)

Arguments

q

character, Query term

subreddit

Restrict results to subreddit (use "!" to negate, comma delimited for multiples)

size

integer, Number of results to return

after

integer, Restrict results to those made after this epoch time

before

integer, Restrict results to those made before this epoch time

parse_date

logical, should epoch time be converted to date? defaults to TRUE

verbose

logical, Whether to display messages

...

Further arguments passed as query parameters. See [ps_params] for all possible parameters.

Details

Use [to_epoch] to convert a date to epoch time

Value

tibble of comments

Examples

## Not run: 
# get the last 100 comments with the word 'cats'
search_comments(q = "cats", size = 100)

## End(Not run)

Search Pushshift.io for Reddit submissions

Description

Search Pushshift.io for Reddit submissions

Usage

search_submissions(
  q = "",
  subreddit = NULL,
  size = 25,
  after = NULL,
  before = NULL,
  parse_date = TRUE,
  verbose = TRUE,
  ...
)

Arguments

q

character, Query term

subreddit

Restrict results to subreddit (use "!" to negate, comma delimited for multiples)

size

integer, Number of results to return

after

integer, Restrict results to those made after this epoch time

before

integer, Restrict results to those made before this epoch time

parse_date

logical, should epoch time be converted to date? defaults to TRUE

verbose

logical, Whether to display messages

...

Further arguments passed as query parameters. See [ps_params] for all possible parameters.

Details

Use [to_epoch] to convert a date to epoch time

Value

tibble of submissions

Examples

## Not run: 
# get the last 100 submissions with the word 'dogs' in the subreddit 'r/animals'
search_submissions(q = "dogs", subreddit = "animals", size = 100)

## End(Not run)

convert date to epoch time

Description

convert date to epoch time

Usage

to_epoch(date)

Arguments

date

date to be converted

Value

epoch time as integer

Examples

to_epoch("2022-12-01")