Package 'PSAWR'

Title: 'Pushshift' API Wrapper for 'Reddit' Submission and Comment Search
Description: Connects to the API of <https://pushshift.io/> to search for 'Reddit' comments and submissions.
Authors: David Schoch [aut, cre]
Maintainer: David Schoch <[email protected]>
License: MIT + file LICENSE
Version: 0.1.0
Built: 2024-10-27 04:49:56 UTC
Source: https://github.com/schochastics/PSAWR

Help Index


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")