Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

User:ArchiveBot: Difference between revisions

520 editsJoined 11 June 2007
Shane (talk | contribs)
Shane (talk | contribs)
 
(14 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Bot|Shane|dev}}
{{Bot|Shane|active}}
Hello. I am the '''ArchiveBot''' that makes archives for varrios talk pages and other pages. I am built using the [http://sourceforge.net/projects/pywikipediabot/ pywikipediabot] Python code. Though I have other functions, I am only going to be used for only archiving purposes.  [http://meta.wikimedia.org/wiki/Archivebot.py Archivebot.py] is the primary file that I use.
Hello. I am the '''ArchiveBot''' that makes archives for various talk pages and other pages. I am built using the [http://sourceforge.net/projects/pywikipediabot/ pywikipediabot] Python code. Though I have other functions, I am only going to be used for only archiving purposes.  [http://botwiki.sno.cc/wiki/Python:Archivebot.py Archivebot.py] is the primary file that I use.


== How to set up archiving? ==
== How to set up archiving? ==


Put the following template on the page that you want automatically archived:
Put the following template on the top of the page that you want automatically archived:


<pre><nowiki>
<pre><nowiki>
{{Template:Archive-bot
{{Template:Archive-bot
| algo = old(...)
|algo = old(...)
| archive = Name of archive page
|archive = Name of archive page
  [ other parameters - read below ]
  [ other parameters - read below ]
}}
}}
Line 19: Line 19:
<pre><nowiki>
<pre><nowiki>
{{Template:Archive-bot
{{Template:Archive-bot
| algo = old(7d)
|algo = old(7d)
| archive = User talk:Example/Archives
|archive = User talk:Example/Archives
}}
}}
</nowiki></pre>
</nowiki></pre>
Line 29: Line 29:
<pre><nowiki>
<pre><nowiki>
{{Template:Archive-bot
{{Template:Archive-bot
| algo = old(48h)
|maxarchivesize = 250K
| archive = User talk:Example/Archive%(counter)d
|counter = 1
| counter = 3
|algo = old(5d)
| maxarchivesize = 250K
|archive = User talk:Example/Archive%(counter)d
}}
}}
</nowiki></pre>
</nowiki></pre>


This tells the bot to archive threads from <code>User talk:Example</code> to <code>User talk:Example/Archive3</code> (more about variables [[#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.
This tells me to archive threads from <code>User talk:Example</code> to <code>User talk:Example/Archive3</code> (more about variables [[#Variables|below]]) until it fills up to 250 kilobytes, whereupon I will move to 4 (updating the counter when saving page). Remember to '''specify the maximum size''' of an archive, or I will behave pretty much like in the first example.


==== Example 3 - Date-based archives ====
==== Example 3 - Date-based archives ====
<pre><nowiki>
<pre><nowiki>
{{Template:Archive-bot
{{Template:Archive-bot
| algo = old(5d)
|algo = old(5d)
| archive = User talk:Example/Archives/%(year)d/%(monthname)s
|archive = User talk:Example/Archives/%(year)d/%(monthname)s
}}
}}
</nowiki></pre>
</nowiki></pre>


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 [[#Variables|below]].
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 [[#Variables|below]].
==== Other things to add ====
Add the {{tl|ArchiveTOC}} template underneath this template so people can get to the archives faster. Archive Index's is something you add to the primary page.


=== Parameters explained ===
=== Parameters explained ===


{| class = "messagebox"
{| class = "messagebox"
! Parameter || Meaning
! Parameter || Meaning
|-
|-
| <tt>archive</tt> || Name of the page to which archived threads will be put. Supports [[#Variables|variables]].
| <tt>archive</tt> || Name of the page to which archived threads will be put. Supports [[#Variables|variables]].
|-
|-
| <tt>algo</tt> || 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 '''<tt>old(...)</tt>''' where '''...''' specifies the maximum age of a thread (in hours or days: ''24h'', ''72h'', ''5d'', ''21d'' etc.)
| <tt>algo</tt> || 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 '''<tt>old(...)</tt>''' where '''...''' specifies the maximum age of a thread (in hours or days: ''24h'', ''72h'', ''5d'', ''21d'' etc.)
|-
|-
| <tt>counter</tt> || The current value of the counter. If the <tt>%(counter)d</tt> variable is not used, it is ignored. Bot will update this parameter as necessary.
| <tt>counter</tt> || The current value of the counter. If the <tt>%(counter)d</tt> variable is not used, it is ignored. Bot will update this parameter as necessary.
|-
| <tt>minthreadsleft</tt> || The minimum number of threads that should be left on a page (to prevent pages from getting completely harvested). Default value: 1
  |-
  |-
  | <tt>maxarchivesize</tt> || Specifies the maximum archive size before incrementing the counter. Ignored if counter is not used.
  | <tt>minthreadstoarchive</tt> || 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: 1
  |}
|-
| <tt>maxarchivesize</tt> || Specifies the maximum archive size before incrementing the counter. Ignored if counter is not used.
|-
  | <tt>archiveheader</tt> || Content that will be put on new archive pages as the header. Supports [[#Variables|variables]]. '''Cannot''' be multiline (use a template like {{tl|archive-message}}).
|-
| <tt>index</tt> || Creates an index of all the archives for the current page. This must equal '''Y''' to work.
|}


=== Variables ===
=== Variables ===
Line 77: Line 88:
  | <tt>%(monthnameshort)s</tt> || first three letters of the name above
  | <tt>%(monthnameshort)s</tt> || first three letters of the name above
  |}
  |}
= When a new archive is created ==
= When a new archive is created =
When a new archive is created, the bot will automaticly add {{tl|archive-message}} to the top. Depending on the type of archive it is creating, the fields will be filled out. As of June 14, 2007, it will only fill out the next archive number.
When a new archive is created, the bot will automaticly add {{tl|archive-message}} to the top. Depending on the type of archive it is creating, the fields will be filled out. As of December 19, 2007, it will only fill out the next archive number.
 
= See Also =
* [[:Category:Automatically archived pages]]

Latest revision as of 18:18, 15 January 2008

This user account facilitates a bot operated by Shane.
ArchiveBot (talk • contribs) is not a sock puppet, but rather an automated or semi-automated account for making repetitive edits too tedious to do without automation. It is currently
__
Active
Admins: if this bot is malfunctioning or causing harm, please block it.

Hello. I am the ArchiveBot that makes archives for various talk pages and other pages. I am built using the pywikipediabot Python code. Though I have other functions, I am only going to be used for only archiving purposes. Archivebot.py is the primary file that I use.

How to set up archiving?

Put the following template on the top of the page that you want automatically archived:

{{Template:Archive-bot
|algo = old(...)
|archive = Name of archive page
 [ other parameters - read below ]
}}

Quick examples

Example 1 - Static archive

{{Template:Archive-bot
|algo = old(7d)
|archive = User talk:Example/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.

Example 2 - Incremental archives

{{Template:Archive-bot
|maxarchivesize = 250K
|counter = 1
|algo = old(5d)
|archive = User talk:Example/Archive%(counter)d
}}

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

Example 3 - Date-based archives

{{Template:Archive-bot
|algo = old(5d)
|archive = User talk:Example/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.

Other things to add

Add the {{ArchiveTOC}} template underneath this template so people can get to the archives faster. Archive Index's is something you add to the primary page.

Parameters explained

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.
minthreadsleft The minimum number of threads that should be left on a page (to prevent pages from getting completely harvested). Default value: 1
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: 1
maxarchivesize Specifies the maximum archive size before incrementing the counter. Ignored if counter is not used.
archiveheader Content that will be put on new archive pages as the header. Supports variables. Cannot be multiline (use a template like {{archive-message}}).
index Creates an index of all the archives for the current page. This must equal Y to work.

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

When a new archive is created

When a new archive is created, the bot will automaticly add {{archive-message}} to the top. Depending on the type of archive it is creating, the fields will be filled out. As of December 19, 2007, it will only fill out the next archive number.

See Also