Skip to content

Commit

Permalink
Update afdbot.php
Browse files Browse the repository at this point in the history
Add transclusion timer to prevent hasty transclusions.
  • Loading branch information
cyberpower678 committed Dec 7, 2013
1 parent 9b92508 commit c5abcf0
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions SnotBot/afdbot.php
Expand Up @@ -62,7 +62,12 @@
if( !in_array( $logpagename, $logpages ) ) { if( !in_array( $logpagename, $logpages ) ) {
$logpagedata = $site->initPage( $logpagename )->get_text( true ); $logpagedata = $site->initPage( $logpagename )->get_text( true );
if( str_ireplace( str_replace( "_", " ", $afd['title'] ), "", str_replace( "_", " ", $logpagedata ) ) == str_replace( "_", " ", $logpagedata ) ) { if( str_ireplace( str_replace( "_", " ", $afd['title'] ), "", str_replace( "_", " ", $logpagedata ) ) == str_replace( "_", " ", $logpagedata ) ) {
transclude( $afd['title'], logPageName( time() ) ); if( time() - $creationdate > 600 ) {
transclude( $afd['title'], logPageName( time() ) );
}
else {
$checkedafds = array_diff( $checkedafds, array( $afd['title'] ) );
}
} }
} }
else { else {
Expand Down Expand Up @@ -569,4 +574,4 @@ function getLogPages() {
function logPageName( $dt ) { function logPageName( $dt ) {
return "Wikipedia:Articles for deletion/Log/".date( 'Y F j', $dt ); return "Wikipedia:Articles for deletion/Log/".date( 'Y F j', $dt );


} }

0 comments on commit c5abcf0

Please sign in to comment.