Manual:Pywikibot/archivebot.py/設定
archivebot.py は議論ページを過去ログ化するスクリプトです。 ここでは議論ページをこのボットによる自動過去ログ化対象にするためのウィキ上の設定を説明しています。 ボットの運用方法については Manual:Pywikibot/archivebot.py をご覧ください。
議論ページの設定方法
このボットは標識テンプレートを明示的に埋め込んだページのみを処理し、指定された期間でセクション (節) を不活性化して過去ログ化します。
標識テンプレートとしてよく使われているのは {{User:MiszaBot/config|...}} です。
テンプレートには下記のパラメーターをつけられます。
(ほとんどは省略可能です。)
{{TEMPLATE_PAGE
|archive =
|algo =
|counter =
|maxarchivesize =
|minthreadsleft =
|minthreadstoarchive =
|archiveheader =
|key =
}}
節を過去ログ化するにはレベル2の節である必要があるので、 ==と記述してください。 指定した節を対象にしないようするには「過去ログ化を防止する方法」をご覧ください。
It is possible to opt-out some sections: see the explanation below.
テンプレートのパラメーター
テンプレートのパラメーターの意味は以下の通りです:
| テンプレートの引数 | 説明 |
|---|---|
archive
|
過去ログ化されたスレッドが入るページの名前。現在のページの下位ページである必要があります。変数を使用できます。 |
algo
|
specifies 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).
|
counter
|
The current value of a counter which could be assigned as variable. Will be actualised by bot. Initial value is 1.
|
maxarchivesize
|
The 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).
|
minthreadsleft
|
ページに最低限残すべきスレッドの数。既定値は 5。
|
minthreadstoarchive
|
The minimum number of threads to archive at once. Default value is 2.
|
archiveheader
|
Content that will be put on new archive pages as the header. This parameter supports the use of variables. Default value is {{talkarchive}}.
|
key
|
A secret key that (if valid) allows archives to not be subpages of the page being archived. |
過去ログページ名を指定するときに使う変数
In the archive parameter in the template, following variables can be used.
| 変数 | 実行結果 |
|---|---|
%(counter)d
|
counter の現在の値
|
%(year)d
|
過去ログ化されるスレッドの年 |
%(quarter)d
|
過去ログ化されるスレッドの四半期番号(1から4) |
%(month)d
|
過去ログ化されるスレッドの月の番号(1-12) |
%(month)02d
|
two-digit numeric month (01-12) |
%(monthname)s
|
月の英語名 |
%(monthnameshort)s
|
月の名前の先頭の 3 文字 |
過去ログ化を防止する方法
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 recognised by the bot.
You can block a thread from being archived effectively indefinitely, using a very distant future timestamp, such as "04:37, 4 11月 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.
関連ページ
- Help:Archiving a talk page#Automated archival – most of what is written there is not specific to English Wikipedia.