Manual:Pywikibot/archivebot.py/setup/cs

The archivebot.py is a script to archive discussion pages. This document explains how to set up discussion pages on-wiki for the automatic archiving done by this bot. For a documentation on how to operate the bot, please see Manuál:Pywikibot/archivebot.py.

Jak ho nastavit pro diskusní stránku

This bot only processes pages that are explicitly marked by transcluding a marker template, and archives sections inactive for a specified duration. A commonly used marker template is {{User:MiszaBot/config|...}}. The template may have parameters described below. (Most of them are optional.)

{{TEMPLATE_PAGE
|archive             =
|algo                =
|counter             =
|maxarchivesize      =
|minthreadsleft      =
|minthreadstoarchive =
|archiveheader       =
|key                 =
}}

For a section to be archived, it must be a level 2 section, marked with ==. It is possible to opt-out some sections: see the explanation below.

Parametry šablony

Meanings of the template's parameters are:

Parametr šablonyPopis
archivename of the page to which archived threads will be put. Must be a subpage of the current page. Variables are supported.
algospecifies the maximum age of a thread. Must be in the form old(delay) where delay specifies the age in hours or days like 24h (24 hours) or 5d (5 days). Default is old(24h).
counterThe current value of a counter which could be assigned as variable. Will be actualized by bot. Initial value is 1.
maxarchivesizeThe maximum archive size before incrementing the counter. Value can be given with appending letter like K or M which indicates KByte or MByte. Default value is 1000M (1000 megabytes).
minthreadsleftMinimum number of threads that should be left on a page. Default value is 5.
minthreadstoarchiveThe minimum number of threads to archive at once. Default value is 2.
archiveheaderContent that will be put on new archive pages as the header. This parameter supports the use of variables. Default value is {{talkarchive}}.
keyA secret key that (if valid) allows archives to not be subpages of the page being archived.

Proměnné pro předlohy názvů stránek

In the archive parameter in the template, following variables can be used.

ProměnnáExpands to...
%(counter)dthe current value of the counter
%(year)dyear of the thread being archived
%(quarter)dquarter of the year (1-4) of the thread being archived
%(month)dnumeric month (1-12) of the thread being archived
%(month)02dtwo-digit numeric month (01-12)
%(monthname)sEnglish name of the month
%(monthnameshort)sfirst three letters of the name of month

Jak zabránit archivaci

To prevent a section (thread) from being archived for a finite time, you can edit the section and insert a signature with a future timestamp. The bot will not archive the thread until that time. Make sure that the signature is well-formatted; it must include a user name and a date exactly in the same format as a proper signature, otherwise it will not be recognized by the bot.

You can block a thread from being archived effectively indefinitely, using a very distant future timestamp, such as "08:26, 2 květen 2045 (UTC)".

To not confuse readers, the dummy signature may be written as a comment only with the dummy user name "DoNotArchiveUntil". Other comments will be ignored by the bot.

You might want to have on your wiki a substitutable template for this particular purpose. See English Wikipedia's template for an example: w:Template:DNAU.

Související odkazy

Category:Pywikibot scripts/cs#archivebot
Category:Pywikibot scripts/cs