User:Hazard-Bot/Archiving

From Wikiquote
Jump to navigation Jump to search
Note: see w:en:User:MiszaBot/Archive HowTo for more details. Remember to convert to User:Hazard-Bot/Archiver!

Format[edit]

See the parameters section for more details.
See examples below.
{{User:Hazard-Bot/Archiver
| archive             = 
| algo                = 
| counter             = 
| maxarchivesize      = 
| minthreadsleft      = 
| minthreadstoarchive = 
| archiveheader       = 
}}

Examples[edit]

Static archive[edit]

{{User:Hazard-Bot/Archiver
| algo    = old(7d)
| archive = User talk:Example/Archive
}}

Example 2 - incremental archives[edit]

{{User:Hazard-Bot/Archiver
| algo                = old(31d)
| archive             = User talk:Example/Archive %(counter)d
| counter             = 1
| maxarchivesize      = 70K
| archiveheader       = {{talk archive navigation}}
| minthreadstoarchive = 1
| minthreadsleft      = 4
}}

Date-based archives[edit]

{{User:Hazard-Bot/Archiver
| algo    = old(5d)
| archive = User talk:Example/Archives/%(year)d/%(monthname)s
}}

Parameters[edit]

Parameter Description
archive Name of the page to which archived threads will be put. Must be a subpage of the current page. Variables are supported.
algo Algorithm that determines how old the last comment in each thread must be before it may be archived. Must be of the form old(<age>) where <age> specifies the minimum age of a thread (in hours or days: 24h, 72h, 5d, 21d etc.)
counter The current value of the counter. Will be ignored if not used. The bot will update this parameter as necessary.
maxarchivesize The maximum archive size before incrementing the counter. Ignored if counter is not used. The values used must be in a #B, #K, #M, or #T format, using a capital letter "B", "K", "M", or "T" respectively. For example: maxarchivesize=256K
minthreadsleft The minimum number of threads that should be left on a page (to prevent pages from getting completely harvested). Default value: 5.
minthreadstoarchive The minimum number of threads to archive at once. Default value: 2.
archiveheader Content that will be put on new archive pages as the header. This parameter supports the use of variables. The value of this parameter cannot be multiline! You may use a template in order to add significant content.

Variables[edit]

Variable parameter Expands to...
%(counter)d the current value of the counter
%(year)d year of the thread being archived
%(month)d month (as a number 1-12) of the thread being archived
%(monthname)s English name of the month above
%(monthnameshort)s first three letters of the name above