DotNetWikiBot Framework Documentation Gets and parses results of specified custom API query.
Only some basic queries are supported and can be parsed automatically.
Namespace: DotNetWikiBotAssembly: DotNetWikiBot (in DotNetWikiBot.dll) Version: 0.0.0.0
Syntax
C# |
---|
public List<Dictionary<string, string>> GetApiQueryResult(
string query,
string queryParams,
int limit
) |
Parameters
- query
- Type: System..::..String
Type of query, e.g. "list=logevents" or "prop=links".
- queryParams
- Type: System..::..String
Additional query parameters, specific to the
query. Options and their descriptions can be obtained by calling api.php on target site
without parameters, e.g. http://en.wikipedia.org/w/api.php,
API Sandbox
is also very useful for experiments.
Parameters' values must be URL-encoded with UrlEncode(String) function
before calling this function.
- limit
- Type: System..::..Int32
Maximum number of resultant strings to fetch.
Return Value
Type:
List<(Of <(<'Dictionary<(Of <(<'String,
String>)>)>>)>)>List of dictionary objects is returned. Dictionary keys will contain the names
of attributes of each found target element, and dictionary values will contain values
of those attributes. If target element is not empty element, it's value will be
included into dictionary under special "_Value" key.
Examples
| Copy |
---|
GetApiQueryResult("list=categorymembers",
"cmnamespace=0|14&cmcategory=" + Bot.UrlEncode("Physical sciences"),
int.MaxValue); |
Examples
| Copy |
---|
GetApiQueryResult("list=logevents",
"letype=patrol&titles=" + Bot.UrlEncode("Physics"),
200); |
Examples
| Copy |
---|
GetApiQueryResult("prop=links",
"titles=" + Bot.UrlEncode("Physics"),
int.MaxValue); |
See Also