view MoinMoin/macro/ @ 5996:524db6237b48

AbandonedPages macro: check user agent to reduce load caused by bots
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 09 Jun 2013 16:35:56 +0200
parents e5a2e21afc17
line wrap: on
line source
# -*- coding: iso-8859-1 -*-
    MoinMoin - AbandonedPages Macro

    This is a list of pages that were not edited for a long time
    according to the edit log; if you shortened the log, the displayed
    information may not be what you expect.

    @copyright: 2001 Juergen Hermann <>
    @license: GNU GPL, see COPYING for details.

from MoinMoin.macro import RecentChanges

def macro_AbandonedPages(macro):
    if macro.request.isSpiderAgent: # reduce bot cpu usage
        return ''
    return RecentChanges.macro_RecentChanges(macro, abandoned=True)