DotNetWikiBot Framework Documentation

The Site type exposes the following members.

Constructors

  NameDescription
Public methodSite(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:
 Copy imageCopy
https://en.wikipedia.org|MyUserName|MyPassword
https://de.wikipedia.org|MyUserName|MyPassword|MyDomain
Each site's accouint must be on the new line. This function allows distributing compiled bots without revealing passwords.
Public methodSite(String, String, String)
This constructor is used to generate most Site objects.
Public methodSite(String, String, String, String)
This constructor is used for LDAP authentication. Additional information can be found here .

Methods

  NameDescription
Public methodCorrectNsPrefix
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:...").
Public methodGetApiQueryResult
Gets and parses results of specified custom API query. Only some basic queries are supported and can be parsed automatically.
Public methodGetEnglishNsPrefix
Gets canonical default English prefix for specified namespace and colon. If default prefix is not found the main local prefix is returned.
Public methodGetNamespace
Identifies the namespace of the page.
Public methodGetNsPrefix
Gets main local prefix for specified namespace and colon.
Public methodGetNsPrefixes
Gets all names and aliases for specified namespace delimited by '|' character and escaped for use within Regex patterns.
Public methodGetWebPage
Gets the text of page from web.
Public methodGetWikimediaProjects
Gets the list of all WikiMedia Foundation wiki sites as listed here.
Public methodLoadMediawikiMessages
Gets MediaWiki system messages (those listed on "Special:Allmessages" page).
Public methodPostDataAndGetResult(String, String)
Posts specified string to requested resource and gets the result text.
Public methodPostDataAndGetResult(String, String, Boolean, Boolean)
Posts specified string to requested resource and gets the result text.
Public methodRemoveNsPrefix
Removes the namespace prefix from page title.
Public methodShowNamespaces
Shows names and integer keys of local and default namespaces and namespace aliases.

Fields

  NameDescription
Public fieldaddress
Site's URI.
Public fieldapiPath
Absolute path to MediaWiki's "api.php" file on the server.
Public fieldcapitalization
Page title capitalization rule on this site. On most sites capitalization rule is "first-letter".
Public fieldcookies
Site's cookies.
Public fielddefaultEditComment
Default edit comment. You can set it to whatever you would like.
Public fielddisambig
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.
Public fieldfetchRate
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.
Public fieldforceSaveDelay
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.
Public fieldgeneralData
Parsed supplementary data, mostly localized strings.
Public fieldindexPath
Absolute path to MediaWiki's "index.php" file on the server.
Public fieldlangCulture
Site's language culture. Required for string comparison.
Public fieldlanguage
Site's language.
Public fieldmaxLag
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.
Public fieldmessages
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.
Public fieldminorEditByDefault
If set to true, all bot's edits are marked as minor by default.
Public fieldname
Site title, e.g. "Wikipedia".
Public fieldnamespaces
Local namespaces, default namespaces and local namespace aliases, joined into strings, enclosed in and delimited by '|' character.
Public fieldregCulture
Randomly chosen regional culture for this site's language. Required to parse dates.
Public fieldregexes
A set of regular expressions for parsing pages. Usually there is no need to edit these regular expressions manually.
Public fieldretryTimes
Number of times to retry bot web action in case of temporary connection failure or some server problems.
Public fieldshortPath
Short relative path to wiki pages (if such alias is set on the server), e.g. "/wiki/". See this page for details.
Public fieldsoftware
Site's software identificator, e.g. "MediaWiki 1.21".
Public fieldtimeOffset
Site's time offset from UTC.
Public fieldtokens
Parsed API session-wide security tokens for editing.
Public fielduseApi
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.
Public fielduserDomain
Default domain for LDAP authentication, if such authentication is allowed on this site. Additional information can be found here.
Public fielduserName
User's account to login with.
Public fielduserPass
User's password to login with.
Public fieldversion
MediaWiki version as Version object.
Public fieldwatchList
User's watchlist. This PageList is not filled automatically when Site object is constructed, you need to call FillFromWatchList()()()() function to fill it.

See Also