query_list_pages {wikkitidy}R Documentation

List pages that meet certain criteria

Description

See API:Lists for available list actions. Each list action returns a list of pages, typically including their pageid, namespace and title. Individual lists have particular properties that can be requested, which are usually prefaced with a two-word code based on the name of the list (e.g. specific properties for the categorymembers list action are prefixed with cm).

Usage

query_list_pages(.req, list, ...)

list_all_list_modules()

Arguments

.req

A httr2_request, e.g. generated by wiki_action_request

list

The type of list to return

...

<dynamic-dots> Additional parameters to the query, e.g. to set configure list

Details

When the request is performed, the data is returned in the body of the request under the query object, labeled by the chosen list action.

If you want to study the actual pages listed, it is advisable to retrieve the pages directly using a generator, rather than listing their IDs using a list action. When using a list action, a second request is required to get further information about each page. Using a generator, you can query pages and retrieve their relevant properties in a single API call.

Value

An HTTP response: an S3 list with class httr2_request

Examples

# Get the ten most recently added pages in Category:Physics
physics_pages <- wiki_action_request() %>%
  query_list_pages("categorymembers",
    cmsort = "timestamp",
    cmdir = "desc", cmtitle = "Category:Physics"
  ) %>%
  next_batch()

physics_pages

[Package wikkitidy version 0.1.12 Index]