Search
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, ... )
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 |
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
if (FALSE) { 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") }