DotNetWikiBot Framework Documentation
The Site type exposes the following members.
Constructors
Name | Description | |||||
---|---|---|---|---|---|---|
Site(String) | This constructor uses default userName and password for site, if
userName and password are found in "Defaults.dat" file in bot's "Cache"
subdirectory. File must be UTF8-encoded and must contain user names and passwords in
the following format:
| |||||
Site(String, String, String) | This constructor is used to generate most Site objects. | |||||
Site(String, String, String, String) | This constructor is used for LDAP authentication. Additional information can
be found here
. |
Methods
Name | Description | |
---|---|---|
CorrectNsPrefix | Function changes default English namespace prefixes and local namespace aliases
to canonical local prefixes (e.g. for German wiki-sites it changes "Category:..."
to "Kategorie:..."). | |
GetApiQueryResult | Gets and parses results of specified custom API query.
Only some basic queries are supported and can be parsed automatically. | |
GetEnglishNsPrefix | Gets canonical default English prefix for specified namespace and colon.
If default prefix is not found the main local prefix is returned. | |
GetNamespace | Identifies the namespace of the page. | |
GetNsPrefix | Gets main local prefix for specified namespace and colon. | |
GetNsPrefixes | Gets all names and aliases for specified namespace delimited by '|' character
and escaped for use within Regex patterns. | |
GetWebPage | Gets the text of page from web. | |
GetWikimediaProjects | Gets the list of all WikiMedia Foundation wiki sites as listed
here. | |
LoadMediawikiMessages | Gets MediaWiki system messages
(those listed on "Special:Allmessages" page). | |
PostDataAndGetResult(String, String) | Posts specified string to requested resource
and gets the result text. | |
PostDataAndGetResult(String, String, Boolean, Boolean) | Posts specified string to requested resource
and gets the result text. | |
RemoveNsPrefix | Removes the namespace prefix from page title. | |
ShowNamespaces | Shows names and integer keys of local and default namespaces and namespace
aliases. |
Fields
Name | Description | |
---|---|---|
address | Site's URI. | |
apiPath | Absolute path to MediaWiki's "api.php" file on the server. | |
capitalization | Page title capitalization rule on this site.
On most sites capitalization rule is "first-letter". | |
cookies | Site's cookies. | |
defaultEditComment | Default edit comment. You can set it to whatever you would like. | |
disambig | Templates, which are used to distinguish disambiguation pages. Set this
variable manually if required. Multiple templates can be specified, use '|'
character as the delimeter. Letters case doesn't matter. | |
fetchRate | Number of list items to fetch at a time. This settings concerns special pages
output and API lists output. Default is 500. Bot accounts are allowed to fetch
up to 5000 items at a time. Adjust this number if required. | |
forceSaveDelay | Number of seconds to pause for between edits on this site.
Adjust this variable if required, but it may be overriden by the site policy. | |
generalData | Parsed supplementary data, mostly localized strings. | |
indexPath | Absolute path to MediaWiki's "index.php" file on the server. | |
langCulture | Site's language culture. Required for string comparison. | |
language | Site's language. | |
maxLag | This is a maximum degree of server load when bot is
still allowed to edit pages. Higher values mean more aggressive behaviour.
See this page
for details. | |
messages | MediaWiki system messages (those listed on "Special:Allmessages" page),
user-modified versions. This dictionary is not filled automatically when Site object
is constructed, you need to call LoadMediawikiMessages(Boolean)
function with "true" parameter to load messages into this dictionary. | |
minorEditByDefault | If set to true, all bot's edits are marked as minor by default. | |
name | Site title, e.g. "Wikipedia". | |
namespaces | Local namespaces, default namespaces and local namespace aliases, joined into
strings, enclosed in and delimited by '|' character. | |
regCulture | Randomly chosen regional culture for this site's language.
Required to parse dates. | |
regexes | A set of regular expressions for parsing pages. Usually there is no need
to edit these regular expressions manually. | |
retryTimes | Number of times to retry bot web action in case of temporary connection
failure or some server problems. | |
shortPath | Short relative path to wiki pages (if such alias is set on the server), e.g.
"/wiki/". See this page
for details. | |
software | Site's software identificator, e.g. "MediaWiki 1.21". | |
timeOffset | Site's time offset from UTC. | |
tokens | Parsed API session-wide security tokens for editing. | |
useApi | If set to false, bot will use MediaWiki's common user interface where
possible, instead of using special API interface for robots (api.php). Default is true.
Set it to false manually if some problem with API interface arises on site. | |
userDomain | Default domain for LDAP authentication, if such authentication is allowed on
this site. Additional information can be found
here.
| |
userName | User's account to login with. | |
userPass | User's password to login with. | |
version | MediaWiki version as Version object. | |
watchList | User's watchlist. This PageList is not filled automatically when
Site object is constructed, you need to call FillFromWatchList()()()()
function to fill it. |