Lompat ke isi

Pengguna:HsfBot/Arsip otomatis: Perbedaan antara revisi

Dari Wikipedia bahasa Indonesia, ensiklopedia bebas
Konten dihapus Konten ditambahkan
Tidak ada ringkasan suntingan
Baris 8: Baris 8:
Letakkan templat berikut di bagian paling atas halaman yang ingin Anda arsipkan secara otomatis:
Letakkan templat berikut di bagian paling atas halaman yang ingin Anda arsipkan secara otomatis:


{{Warning|Kode di bawah tidak akan bekerja -lihat contoh untuk mengisis opsi yang sesuai-}}
{{Warning|Kode di bawah tidak akan bekerja -lihat contoh untuk mengisi opsi yang sesuai-}}


<pre style="overflow: auto">
<pre style="overflow: auto">
Baris 20: Baris 20:
Well, maybe '''not exactly''' that (read about required options below), but that's how it's done. By the way, [[User:HsfBot/config|the template]] has '''no content''' and is sysop-'''protected''', so don't worry about visual appearance. :)
Well, maybe '''not exactly''' that (read about required options below), but that's how it's done. By the way, [[User:HsfBot/config|the template]] has '''no content''' and is sysop-'''protected''', so don't worry about visual appearance. :)
-->
-->
Bot hanya mengenali satu parameter per baris. Penutupan }} harus berada pada baris tersendiri. Tidak boleh ada spasi sebelum pipa (|). Jika Anda mengeluarkan data baru yang digunakan pada contoh di atas, mis. Dengan meringkas pemanggilan templat ke satu baris, bot mungkin tidak melakukan apa yang Anda harapkan.
Bot hanya mengenali satu parameter per baris. Penutupan <code>}}</code> harus berada pada baris tersendiri. Tidak boleh ada spasi sebelum pipa ( <code>|</code> ). Jika Anda mengeluarkan data baru yang digunakan pada contoh di atas, mis. Dengan meringkas pemanggilan templat ke satu baris, bot mungkin tidak melakukan apa yang Anda harapkan.


Selain itu, templat harus ditempatkan:
Selain itu, templat harus ditempatkan:
# sebelum header == tingkat kedua == pertama di halaman
# sebelum header <code>== tingkat kedua ==</code> pertama di halaman
# pada halaman sebenarnya dan tidak ditransklusikan dari subhalaman, seperti header halaman, templat, dll.
# pada '''''halaman sebenarnya''''', dan tidak ditransklusikan dari subhalaman, seperti header halaman, templat, dll.


=== Contoh cepat ===
=== Contoh cepat ===

Revisi per 9 Desember 2017 11.57

Menyiapkan pengarsipan

Letakkan templat berikut di bagian paling atas halaman yang ingin Anda arsipkan secara otomatis:

{{User:HsfBot/config
| algo    = old(...)
| archive = Nama halaman arsip: Untuk menghasilkan beberapa halaman dari waktu ke waktu, gunakan variabel, yang dijelaskan di bawah ini.
[parameter lain - ***baca di bawah ini***]
}}

Bot hanya mengenali satu parameter per baris. Penutupan }} harus berada pada baris tersendiri. Tidak boleh ada spasi sebelum pipa ( | ). Jika Anda mengeluarkan data baru yang digunakan pada contoh di atas, mis. Dengan meringkas pemanggilan templat ke satu baris, bot mungkin tidak melakukan apa yang Anda harapkan.

Selain itu, templat harus ditempatkan:

  1. sebelum header == tingkat kedua == pertama di halaman
  2. pada halaman sebenarnya, dan tidak ditransklusikan dari subhalaman, seperti header halaman, templat, dll.

Contoh cepat

Untuk mengatasinya - konfigurasi mungkin tidak intuitif, tapi fleksibel dan berpotensi memberikan kemungkinan besar.

Silahkan ganti "Pembicaraan pengguna:Contoh" ke nama tepatnya dari halaman Anda sendiri!
'Jika masih tidak berfungsi, baca tentang parameter minthreadsleft dan 'minthreadstoarchive di bawah ini.

Contoh 1: arsip statis

{{User:HsfBot/config
| algo    = old(7d)
| archive = Pembicaraan pengguna:Example/Archive
}}

Pengaturan ini mengarsipkan benang dari Pembicaraan pengguna:Example ke Pembicaraan pengguna: Example / Archive setelah berumur 7 hari (terhitung dari cap waktu terbaru). Arsip 'akan membeku saat menjadi 2000KB besar' . Mungkin bukan konfigurasi yang sangat berguna (kecuali untuk mengirim benang ke tempat sampah sampah yang telah dibersihkan secara berkala atau untuk menentukan kapan Anda harus pergi ke halaman arsip berikutnya), tapi ini yang paling mudah, jadi saya menyebutkannya terlebih dulu.

Contoh 2: Arsip berkesinambungan

{{User:HsfBot/config
| algo                = old(30d)
| archive             = Pembicaraan pengguna:Example/Archive %(counter)d
| counter             = 1
| maxarchivesize      = 150K
| archiveheader       = {{Automatic archive navigator}}
| minthreadstoarchive = 1
| minthreadsleft      = 4
}}
copy dan paste agar mudah digunakan
{{User:HsfBot/config
| algo                = old(30d)
| archive             = {{SUBST:FULLPAGENAME}}/Archive %(counter)d
| counter             = 1
| maxarchivesize      = 150K
| archiveheader       = {{Automatic archive navigator}}
| minthreadstoarchive = 1
| minthreadsleft      = 4
}}

Ini memberitahu bot untuk mengarsipkan benang lebih dari tiga puluh hari (meninggalkan yang keempat terakhir) dari Pembicaraan pengguna: Contoh ke Pembicaraan pengguna: Contoh / Arsip 1 (lebih lanjut tentang variabel [[#Variables | below] ]) sampai mengisi sampai 150 kilobyte, lalu bot akan berpindah ke 2 (memperbarui meja saat menyimpan halaman). Ingatlah untuk 'tentukan ukuran maksimum' arsip, atau akan berperilaku cukup banyak seperti pada contoh pertama. Selain itu, setiap halaman arsip diberi banner {{Aan}}, yang memudahkan untuk berpindah di antara halaman arsip yang berbeda.

Contoh 3: arsip berbasis tanggal

{{User:HsfBot/config
| algo          = old(5d)
| archive       = Pembicaraan pengguna:Example/Archives/%(year)d/%(monthname)s
| archiveheader = {{MonthlyArchive}}
}}
copy and paste for easy use
{{User:HsfBot/config
| algo          = old(5d)
| archive       = {{SUBST:FULLPAGENAME}}/%(year)d/%(monthname)s
| archiveheader = {{MonthlyArchive}}
}}

Dalam konfigurasi ini, topik yang lebih tua dari 5 hari akan mendarat di arsip tergantung tanggalnya (yaitu timestamp terbaru). Anda bisa membaca tentang variabel lain dibawah.

Penjelasan parameter

{{User:HsfBot/config 
| archive             = 
| algo                = 
| counter             = 
| maxarchivesize      = 
| minthreadsleft      = 
| minthreadstoarchive = 
| archiveheader       = 
| key                 = 
}}
Parameter Default Description
archive N/A; required Name of the page to which archived threads will be put. This parameter supports the use of variables, which can be used to create dynamically named archives (such as using date ranges). Note that magic words and templates do not work with this parameter, and unless a key is supplied (see below), the target page must be a subpage of the current page.
algo old(24h) 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 1 The current number of the last archive. If the %(counter)d variable is not used, it is ignored. Lowercase sigmabot III will update this parameter as necessary.
maxarchivesize 1954K The maximum archive size in either raw text size (eg 256M for megabytes, 256K for kilobytes, or 256B for bytes) or threads (eg 10T) before incrementing the counter. A bare integer will be interpreted as bytes. Ignored if counter is not used.
minthreadsleft 5 The minimum number of threads that should be left on a page (to prevent pages from getting completely harvested).
minthreadstoarchive 2 The minimum number of threads to archive at one time, which is used to lower edit frequency. lowercase sigmabot III will not archive threads when fewer than the value of this parameter would be archived.
archiveheader {{Talk archive}} Content that will be put on new archive pages as the header. This parameter supports the use of variables.
key A top-secret key that (if valid) allows archives to not be subpages of the page being archived. To obtain such a key, request it from this editor, and you better have a very good justification for doing so.

Variables

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

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.

After you have set up archiving

The bot runs once a day at a preset hour, or twice a day for WP:AN and WP:AN/I. Simply wait for the next cycle and you should see the bot's entries in the history list of your article providing there was anything to archive, and the history list entry should provide a link to the archive page you specified.

Various templates will produce an automatic list of archive subpages. Typically, such a template will be added to the top-level talk page to make archives easier to find. Simply add the template name in {{curly-braces}} where you want it to appear. Popular templates used for this purpose include:

Delaying or preventing archiving of particular threads

Archiving can be delayed for a particular thread by substituting the template {{DNAU}} into the thread. Use {{subst:DNAU}} to retain a thread indefinitely, or {{subst:DNAU|<integer>}} to retain a thread for <integer> days. see the template documentation for details about its use and function.