# HG changeset patch # User Peter Gervai # Date 1708629682 -3600 # Node ID 38415be9f910f26d68d13027408810ab4be262bf # Parent 0d6c71adcee95b3752d28711fb1effc9c35170f7 Skipping {{nobots}} pages diff -r 0d6c71adcee9 -r 38415be9f910 delinquent_files/demon.php --- a/delinquent_files/demon.php Sat Feb 17 15:36:33 2024 +0100 +++ b/delinquent_files/demon.php Thu Feb 22 20:21:22 2024 +0100 @@ -80,6 +80,12 @@ } return false ; } + + ## page content forbidding bots, like {{nobots}} or {{bots|deny=..us..}} + function isForbiddenPage ( $content ) { + if ( preg_match( '\{\{nobots\}\}|\{\{bots\s*\|\s*deny=([^}]*CommonsDelinker|all)', $content) ) return true; + return false; + } function getRecentDeletedFiles ( $max_ts ) { # Open Commons database replica @@ -402,6 +408,12 @@ $rev_id = $revision->getId() ; $text = $revision->getContent()->getData() ; + if ( $this->isForbiddenPage( $text ) ) { + $this->d->info("Skipping forbidden (nobots) page $e->wiki: $e->page"); + $this->setDone( $e->id, 2, "Change forbidden (nobots)" ); + return; + } + $file = $e->file ; $pattern = $this->matcher->matcher_prepare_pattern( $file );