Pour pouvoir importer des images sur le serveur et consulter le wiki sans publicité, vous devez vous connecter.

GWiki:Archivage automatique

Guild Wars Wiki en français
Aller à la navigation Aller à la recherche
En construction.png
  • Cet article n'est pas fini. Son état est provisoire et vous pouvez nous aider à l'améliorer.

Description

Ce modèle sert à déclarer une page à archiver auprès du robot qui maintient les archives.

Utilisation

Insérez ce modèle dans la page à archiver (en haut de page pour facilité la lecture) :

{{Archivage automatique
|algo = old(...)
|archive = Nom de la page d'archives
[autres paramètres - voir ci-dessous]
}}

Ceci est un exemple, vous devez mettre des paramètres valables pour que le robot les comprenne.

Exemples

Changez "Discussion Utilisateur:Exemple" par le nom de votre page !

Exemple 1 - Archivage statique

{{Archivage automatique
|algo = old(7d)
|archive = Discussion Utilisateur:Exemple/Archives
}}

This setup archives threads from User talk:Example to User talk:Example/Archive after they are 7 days old (counting from newest timestamp). The archive will grow indefinitely. Probably not a very useful config (unless for sending threads to a periodically cleaned trash bin), but it's easiest, so I'm mentioning it first.

Exemple 2 - Archivage pondéré

{{Archivage automatique
|algo = old(48h)
|archive = Discussion Utilisateur:Exemple/Archive %(counter)d
|counter = 3
|maxarchivesize = 250K
}}

This tells the bot to archive threads from User talk:Example to User talk:Example/Archive 3 (more about variables below) until it fills up to 250 kilobytes, whereupon the bot will move to 4 (updating the counter when saving page). Remember to specify the maximum size of an archive, or it will behave pretty much like in the first example.

Exemple 3 - Archivage périodique

{{Archivage automatique
|algo = old(5d)
|archive = Discussion Utilisateur:Exemple/Archives/%(year)d/%(monthname)s
}}

In this configuration, threads older than 5 days will land in archives depending on their date (that is newest timestamp). You can read about other variables below.

Paramètres

parameter meaning
archive Name of the page to which archived threads will be put. Supports variables.
algo Algorithm that instructs the bot how to decide whether to archive a thread or not. Complex formulas (including regex matching) will be available in the future, but so far it must be of the form old(...) where ... specifies the maximum age of a thread (in hours or days: 24h, 72h, 5d, 21d etc.)
counter The current value of the counter. If the %(counter)d variable is not used, it is ignored. Bot will update this parameter as necessary.
maxarchivesize The maximum archive size before incrementing the counter. Ignored if counter is not used.
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 one time (lowers edit frequency by refusing to act when only few threads would be archived). Default value: 2
archiveheader Content that will be put on new archive pages as the header. Supports variables. Cannot be multiline (use a template like Modèle:Tl). Defaults to Modèle:Tl.
key Secret key that (if valid) allows archives to not be subpages of the page being archived. To obtain such a key, ask me and have a good reason for that. :-)

Variables

variable... ...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

Those python-savvy people will immediately recognize these variables are filled at runtime with the % operator and should know how to adjust the format. A few points of interest to others:

  • make sure you don't mess up the last letter after the brackets (it's "d" for integers and "s" for strings)
  • integer variables may be left-padded with zeros:
    %(counter)03d evaluates to 013 if the counter's value equals 13,
    %(month)02d becomes 05 for May etc.