dg_search: Search

Description Usage Arguments Details Examples

View source: R/search.R

Description

Search

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
dg_search(
  query = NULL,
  order = NULL,
  status = NULL,
  category = NULL,
  username = NULL,
  group = NULL,
  badge = NULL,
  in_ = NULL,
  posts_count = NULL,
  min_age = NULL,
  max_age = NULL,
  page = 1,
  ...
)

Arguments

query

(character) Query terms. Required.

order

(character) One of views, latest, likes

status

(character) One of open, closed, archived, noreplies, or single_user

category

(character) Category to search for

username

(character) User name

group

(character) Groupo name

badge

(character) Badge name

in_

(character) One of likes, posted, watching, tracking, private, bookmarks, first

posts_count

(integer) Number of posts per topic

min_age

(integer) Minimum age

max_age

(integer) Maximum age

page

(integer) a page number for pagination. records per page is fixed at 50 (that is: up to 50). default: 1

...

Named parameters passed on to HttpClient

Details

This uses the /search API route

all parameters except page are combined into a single API query parameter called q, separated with +. individual parameters are collapsed with colons. So a function call like dg_search(query = "tags:r", page = 1) will turn in to /search?q=tags:r&page=1

Parameters not defined here can still be passed to query, with a pattern a:b, where a is the field to query on, and b is the term passed to a. See example below for tags

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
dg_search(query = "tags:r", page = 1)
dg_search(query = "tags:r", page = 2)
dg_search(query = "tags:r", page = 3)
dg_search(query = "poo")
dg_search(posts_count = 2, status = "open")
dg_search(in_ = "posted")
dg_search(status = "open")

## End(Not run)

sckott/discgolf documentation built on March 10, 2021, 5:30 p.m.