User:Archivist

From RationalWiki
Jump to: navigation, search
Shortcuts:

Contents

[edit] How to archive

[edit] Copy-pasta

Copy-paste this at the top of a talkpage:

{{Talkpage/Pibot
|algo=old(30d)
|archive={{subst:NAMESPACE}}:{{subst:PAGENAME}}/Archive%(counter)d
|maxarchivesize=100K
|search=yes
}}

This will archive sections that have been inactive for 30 days. Change "30d" for other times; "24h" for 24 hours, "60d" for 60 days, etc.

[edit] Prevent archiving

The easiest way is to add (sticky) at the end of a section title. EG:

== Hi there (sticky) ==

You can also add a fake timestamp to a section. EG, the below prevents the bot from archiving until the 1st of December 2017 plus whatever you set |algo to:

<!-- Prevent Archive 21:09, 1 December 2017 (UTC) -->

[edit] Bot info

[edit] Command-line

At 8 every day, this script runs:

pwb.py archivebot.py Talkpage/PibotHidden 2>&1 -all -v -log
pwb.py archivebot.py Talkpage/Pibot 2>&1 -all -v -log

[edit] archivebot.py

To respect sticky threads, archivebot.py is edited:

Standard:
    def should_be_archived(self, archiver):
        algo = archiver.get_attr('algo')
        re_t = re.search(r'^old\((.*)\)$', algo)
		
        if re_t:
            if not self.timestamp:
                return ''
            # TODO: handle this:
            # return 'unsigned'
            maxage = str2time(re_t.group(1))
            if self.now - self.timestamp > maxage:
                duration = str2localized_duration(archiver.site, re_t.group(1))
                return i18n.twtranslate(self.code,
                                        'archivebot-older-than',
                                        {'duration': duration})
        return ''
Edit:
    def should_be_archived(self, archiver):
        algo = archiver.get_attr('algo')
        re_t = re.search(r'^old\((.*)\)$', algo)
		
        if re_t:
            if not self.timestamp:
                return ''
            if self.title.lower().endswith('(sticky)') or self.title.lower().startswith('(sticky)'):
                return ''
            # TODO: handle this:
            # return 'unsigned'
            maxage = str2time(re_t.group(1))
            if self.now - self.timestamp > maxage:
                duration = str2localized_duration(archiver.site, re_t.group(1))
                return i18n.twtranslate(self.code,
                                        'archivebot-older-than',
                                        {'duration': duration})
        return ''

[edit] Recent edits

See Special:Contributions/Archivist.

Personal tools
Namespaces

Variants
Actions
Navigation
support
Community
Tools