QueryPushshift: Query data from pushshift.io

Description Usage Arguments Value Functions Examples

View source: R/pawr.R

Description

Query data from pushshift.io

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
QueryPushshift(
  type = c("comment", "submission", "subreddit"),
  as.df = T,
  purge = F,
  verbose = getOption("PAWR.VerboseGet"),
  size = getOption("PAWR.QuerySize"),
  aggs = c("none", "author", "link_id", "created_utc", "subreddit"),
  agg_size = 0,
  q = NULL,
  metadata = TRUE,
  ...
)

QueryPushshiftMeta()

Arguments

type

Type of requested content. Can be comment, submission, or subreddit.

as.df

Convert output to data.frame? Defaults to TRUE.

purge

Purge deleted posts? Defaults to FALSE.

verbose

Should output be verbose? Defaults to a global option which can be set with options(PAWR.VerboseGet=TRUE/FALSE).

size

Maximum number of pieces of content to return. Defaults to the maximum, which is 500, except when using aggs, when it defaults to 0.

agg_size

Maximum number of values to return when using aggs; defaults to 500 unless you're not using aggs.

q

Query term.

metadata

Request metadata from pushshift, which will be used to check whether the query was successful or some of pushshift's shards failed to respond. This is recommended for academic research.

...

Other valid parameters. Run PSParams() to see all valid parameters and their descriptions.

Value

If as.df=T, returns a data.frame; else, returns a list.

Functions

Examples

1
2
3
4
5
6
#Get u/spez's first ever comment
QueryPushshift(author="spez",after=0,size=1)

#See in which subreddits the word "gamer" is used the most
QueryPushshift(q="Gamer",aggs="subreddit")
QueryPushshiftMeta()$client_user_agent

Spiritspeak/PAWR documentation built on March 21, 2021, 4:14 p.m.