View source: R/generator-query-type.R
query_generate_pages | R Documentation |
Many of the endpoints on the Action API can be used as generators
. Use
list_all_generators()
to see a complete list. The main advantage of using a
generator is that you can chain it with calls to query_page_properties()
to
find out specific information about the pages. This is not possible for
queries constructed using query_list_pages()
.
query_generate_pages(.req, generator, ...)
list_all_generators()
.req |
A httr2_request, e.g. generated by |
generator |
The generator module you wish to use. Most list and property modules can be used, though not all. |
... |
< |
There are two kinds of generator
: list-generators and prop-generators. If
using a prop-generator, then you need to use a query_by_()
function to tell
the API where to start from, as shown in the examples.
To set additional parameters to a generator, prepend the parameter with "g".
For instance, to set a limit of 10 to the number of pages returned by the
categorymembers
generator, set the parameter gcmlimit = 10
.
query_generate_pages: The modified request, which can be passed to next_batch or retrieve_all as appropriate.
list_all_generators: a tibble of all the available generator
modules. The name
column gives the name of the generator, while the
group
column indicates whether the generator is based on a list module
or a property module. Generators based on property modules can only be
added to a query if you have already used query_by_ to specify which
pages' properties should be generated.
gracefully()
# Search for articles about seagulls
seagulls <- wiki_action_request() %>%
query_generate_pages("search", gsrsearch = "seagull") %>%
gracefully(next_batch)
seagulls
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.