DotNetWikiBot Framework Documentation
The PageList type exposes the following members.
Constructors
Name | Description | |
---|---|---|
PageList()()()() | This constructor creates empty PageList object using most recently
created Site object. | |
PageList(Site) | This constructor creates empty PageList object with specified
Site object. | |
PageList(Site, List<(Of <<'(String>)>>)) | This constructor creates PageList object with specified Site object and fills
it with Page objects with specified titles. When constructed, new
Page in PageList don't contain text. Use Load()()()()
method to get texts and metadata from live wiki. | |
PageList(Site, array<String>[]()[][]) | This constructor creates PageList object with specified Site object and fills
it with Page objects with specified titles. When constructed, new
Page in PageList doesn't contain text. Use Load()()()()
method to get texts and metadata from live wiki. |
Methods
Name | Description | |
---|---|---|
Add | This function adds specified page to the end of this PageList. | |
AddTemplate | Adds a specified template to the end of all pages in PageList. | |
AddToCategory | Adds all pages in PageList to the specified category by adding
links to that category in pages texts. | |
Clear | Removes all pages from PageList. | |
ComparePagesByTitles | Compares pages by titles in language-specific manner. This is required to
compare titles in Japanese, Chinese, etc. properly | |
Contains(String) | This function returns true, if a page with specified title exists
in this PageList. This function corrects all namespace prefixes in this PageList
before comparison. | |
Contains(Page) | This function returns true, if this PageList contains page with the same title
and same revision ID with page passed as a parameter. Before comparison this function
corrects all namespace prefixes in this PageList and in title of Page passed
as a parameter. | |
CorrectNsPrefixes | Function changes default English namespace prefixes to correct local prefixes
(e.g. for German wiki-sites it changes "Category:..." to "Kategorie:..."). | |
Count | This function returns the number of pages in PageList. | |
FillAllFromCategory | This function fills this PageList with pages from specified
category page, subcategories are also included. | |
FillAllFromCategoryTree | Gets all levels of subcategories of some wiki category (that means
subcategories, sub-subcategories, and so on) and fills this PageList with titles
of all pages, found in all levels of subcategories. The multiplicates of recurring pages
are removed. Subcategory pages are included.
This operation may be very time-consuming and traffic-consuming.
The function clears the PageList before filling begins. | |
FillAndLoadFromFiles | Gets page titles and page texts from all ".txt" files in the specified
directory (folder). Each file becomes a page. Page titles are constructed from
file names. Page text is read from file contents. If any Unicode numeric codes
(also known as numeric character references or NCRs) of the forbidden characters
(forbidden in filenames) are recognized in filenames, those codes are converted
to characters (e.g. "|" is converted to "|"). | |
FillAndLoadFromXmlDump | Gets page titles and page text from local XML dump.
This function consumes much resources. | |
FillFromAllPages(String, Int32, Boolean, Int32) | Gets page titles for this PageList from "Special:Allpages" MediaWiki page.
That means a list of pages in alphabetical order. | |
FillFromAllPages(String, Int32, Boolean, Int32, String) | Gets page titles for this PageList from "Special:Allpages" MediaWiki page.
That means a list of pages in alphabetical order. | |
FillFromCategory | Fills this PageList with pages from specified category page. Subcategories are
not included, call FillAllFromCategory(String) function instead
to get category contents with subcategories. | |
FillFromCategoryTree | Gets all levels of subcategories of some wiki category (that means
subcategories, sub-subcategories, and so on) and fills this PageList with titles
of all pages, found in all levels of subcategories. The multiplicates of recurring pages
are removed. Subcategory pages are excluded from resultant list, call
FillAllFromCategoryTree(String) function instead to get PageList
with subcategories on board.
This operation may be very time-consuming and traffic-consuming.
The function clears the PageList before filling begins. | |
FillFromChangedWatchedPages | Gets page titles for this PageList from list of recently changed
watched articles (watched by bot account). The function does not internally
remove redirecting pages from the results. Call RemoveRedirects()()()()
manually, if you need it. And the function neither filters namespaces, nor clears
the existing PageList, so new titles will be added to the existing
in PageList. | |
FillFromCustomApiQuery | Gets page titles for this PageList from results of specified custom API query.
Not all queries are supported and can be parsed automatically. The function does not
clear the existing PageList, so new titles will be added to existing. | |
FillFromCustomLog | Gets page titles for this PageList from specified MediaWiki events log.
The following logs are supported:
block, protect, rights, delete, upload, move, import, patrol, merge, suppress,
review, stable, spamblacklist, gblblock, renameuser, globalauth, gblrights,
abusefilter, newusers.
The function does not filter namespaces and does not clear the
existing PageList, so new pages will be added to existing pages. | |
FillFromCustomSpecialPage | Gets page titles for this PageList from specified special page.
The following special pages are supported (other were not tested):
Ancientpages, BrokenRedirects, Deadendpages, Disambiguations, DoubleRedirects,
Listredirects, Lonelypages, Longpages, Mostcategories, Mostimages, Mostlinkedcategories,
Mostlinkedtemplates, Mostlinked, Mostrevisions, Fewestrevisions, Shortpages,
Uncategorizedcategories, Uncategorizedpages, Uncategorizedimages,
Uncategorizedtemplates, Unusedcategories, Unusedimages, Wantedcategories, Wantedfiles,
Wantedpages, Wantedtemplates, Unwatchedpages, Unusedtemplates, Withoutinterwiki.
The function doesn't filter namespaces and does not clear PageList,
so new pages will be added to existing pages. | |
FillFromFile | Gets page titles from UTF8-encoded file. Each title must be on a new line.
The function does not clear the existing PageList, new pages will be added. | |
FillFromGoogleSearchResults | Gets page titles for this PageList from Google search results.
The function gets pages of all namespaces and it does not clear
the existing PageList, so new pages will be added. | |
FillFromLinksToPage | Gets titles of pages which link to specified page. Results include redirects,
call RemoveRedirects()()()() to get rid of them. The
function does not clear the existing PageList, so new titles will be added. | |
FillFromPageHistory | Gets page history and fills this PageList with specified number of recent page
revisions. Pre-existing pages will be removed from this PageList.
Only revision identifiers, user names, timestamps and comments are
loaded, not the texts. Call Load()()()() to load the texts of page
revisions. PageList[0] will be the most recent revision. | |
FillFromPageLinks | Gets page titles for this PageList from links in some wiki page. All links
will be retrieved, from all namespaces, except interwiki links to other
sites. Use FilterNamespaces(array<Int32>[]()[][]) or
RemoveNamespaces(array<Int32>[]()[][]) function to remove pages from
unwanted namespaces (categories, images, etc.) | |
FillFromPagesUsingImage | Gets titles of pages, in which the specified image file is included.
Function also works with non-image files. | |
FillFromRecentChanges | Gets page titles for this PageList from recent changes page,
"Special:Recentchanges". File uploads, page deletions and page renamings are
not included, use
FillFromCustomLog(String, String, String, Int32)
function instead to fill from respective logs.
The function does not clear the existing PageList, so new titles will be added.
Use FilterNamespaces(array<Int32>[]()[][]) or
RemoveNamespaces(array<Int32>[]()[][]) functions to remove
pages from unwanted namespaces. | |
FillFromSearchResults | Gets page titles for this PageList from site's internal search results.
The function does not filter namespaces. And the function does not clear
the existing PageList, so new titles will be added. | |
FillFromTransclusionsOfPage | Gets titles of pages which transclude (embed) the specified page. The function
does not clear the existing PageList, so new titles will be added. | |
FillFromUserContributions | Gets page titles for this PageList from user contributions
of specified user. The function does not remove redirecting
pages from the results. Call RemoveRedirects()()()() manually,
if you require it. And the function does not clears the existing PageList,
so new titles will be added. | |
FillFromWatchList | Gets page titles for this PageList from watchlist
of bot account. The function does not remove redirecting
pages from the results. Call RemoveRedirects()()()() manually,
if you need that. And the function neither filters namespaces, nor clears the
existing PageList, so new titles will be added to the existing in PageList. | |
FilterNamespaces | Removes pages that are not in the given namespaces. | |
GetEnumerator | This function allows to iterate over Page objects in this
PageList using "foreach" loop. | |
GetPage | This function allows to access individual pages in this PageList.
But it's better to use simple pageList[i] syntax. | |
Insert | Inserts an element into this PageList at the specified index. | |
IsEmpty | Shows if there are any Page objects in this PageList. | |
Load | Loads text for pages in PageList from site via common web interface.
Please, don't use this function when going to edit big amounts of pages on
popular public wikis, as it compromises edit conflict detection. In that case,
each page's text should be loaded individually right before its processing
and saving. | |
Protect | Protects or unprotects all pages in this PageList, so only chosen category
of users can edit or rename it. Changing page protection modes requires administrator
(sysop) rights on target wiki. | |
Remove | Removes a page with specified title from this PageList. | |
RemoveAll | Removes all pages from PageList. | |
RemoveDisambigs | Removes all disambiguation pages from PageList. But firstly don't
forget to load the pages from site using Load()()()(). | |
RemoveEmpty | Removes all empty pages from PageList. But firstly don't forget to load
the pages from site using pageList.LoadWithMetadata(). | |
RemoveFromCategory | Removes all pages in PageList from specified category by deleting
links to that category in pages texts. | |
RemoveNamespaces | Removes the pages, that are in given namespaces. | |
RemovePage | Removes page at specified index from PageList. | |
RemoveRecurring | Removes all recurring pages from PageList. Only one page with some title will
remain in PageList. This makes all page elements in PageList unique. | |
RemoveRedirects | Removes all redirecting pages from PageList. But firstly don't forget to load
the pages from site using Load()()()(). | |
RemoveTemplate | Removes a specified template from all pages in PageList. | |
ResolveRedirects | For all redirecting pages in this PageList, this function loads the titles and
texts of redirected-to pages. | |
Revert | Undoes the last edit of every page in this PageList, so every page text reverts
to previous contents. The function doesn't affect other operations
like renaming. | |
Save()()()() | Saves all pages in PageList to live wiki site. Uses
defaultEditComment and minorEditByDefault
settings. This function doesn't limit the saving speed, so in case of working on
public wiki, it's better to use SaveSmoothly()()()() function in order
to decrease server load. | |
Save(String, Boolean) | Saves all pages in PageList to live wiki site. This function
doesn't limit the saving speed, so in case of working on public wiki it's better
to use SaveSmoothly(Int32, String, Boolean)
function in order to decrease server load. | |
SaveSmoothly()()()() | Saves all pages in PageList to live wiki site. The function waits for
forceSaveDelay seconds (or for 5 seconds if
forceSaveDelay equals zero, the default)
between each page save operation in order to decrease server load. It uses
defaultEditComment and minorEditByDefault
settings. | |
SaveSmoothly(Int32) | Saves all pages in PageList to live wiki site. The function waits for specified
number of seconds between each page save operation in order to decrease server load.
It uses defaultEditComment and minorEditByDefault
settings. | |
SaveSmoothly(Int32, String, Boolean) | Saves all pages in PageList to live wiki site. The function waits for specified
number of seconds between each page save operation in order to decrease server load.
| |
SaveTitlesToFile | Saves titles of all pages in PageList to the specified file. Each title
on a separate line. If the target file already exists, it is overwritten. | |
SaveToFiles | Saves the contents of all pages in pageList to ".txt" files in specified
directory. Each page is saved to separate file, the name of that file is constructed
from page title. Forbidden characters in filenames are replaced with their
Unicode numeric codes (also known as numeric character references or NCRs).
If the target file already exists, it is overwritten. | |
SaveXmlDumpToFile | Loads the contents of all pages in this pageList from live wiki site via XML
export interface and saves the retrieved XML content to the specified file.
The functions just dumps data, it does not load pages in PageList itself,
call Load()()()() or
FillAndLoadFromXmlDump(String) to do that.
Note that on some sites MediaWiki messages
from standard namespace 8 are not available for export. | |
SetPageAtIndex | This function allows to set individual pages in this PageList.
But it's better to use simple pageList[i] syntax. | |
ShowTexts | Sends texts of all contained pages to console. | |
ShowTitles | Sends titles of all contained pages to console. | |
Sort | This function sorts all pages in PageList by titles. | |
Unwatch | Removes all pages in this PageList from bot account's watchlist. | |
Watch | Adds all pages in this PageList to bot account's watchlist. |
Fields
Name | Description | |
---|---|---|
pages | Internal generic List that contains collection of pages. | |
site | Site, on which the pages are located. |
Properties
Name | Description | |
---|---|---|
Item[([( Int32])]) | This index allows to call pageList[i] instead of pageList.pages[i]. | |
Item[([( String])]) | This index allows to use pageList["title"] syntax. Don't forget to use correct
local namespace prefixes. Call CorrectNsPrefixes()()()() function to correct
namespace prefixes in a whole PageList at once. |