User:ClueBot II/wikiprojectarchival.js

set %tmp ''; set %cm ''; getcategorymembers %tmp "\n" 'WikiProjects'; varappend %cm %tmp; set %count $gettok(%cm,"\n",0); while (%count == 500) { getcategorymembers %tmp "\n" 'WikiProjects' $gettok(%tmp,"\n",500); varappend %cm $cat("\n",%tmp); set %count $gettok(%cm,"\n",0); } set %pages ''; foreach %cm "\n" %page { if ($gettok(%page,':',1,2) == 'Wikipedia') { set %name $gettok(%page,':',2,2); if ($strpos(%name,'/') == (-1)) { getmodifiedtime %pmod %page; if (($time(0) - %pmod) >= 5184000) { getmodifiedtime %tmod $cat('Wikipedia talk:',%name); if (($time(0) - %tmod) >= 5184000) { pageget %page %data; if ($stripos(%data,'') == (-1)) { varprepend %data "\n"; }					set %data $pregreplace(%data,'/\[\[Category:WikiProjects(\|[^\x5d]*)?\]\]/i',''); pageset %page %data 'Tagging inactive WikiProject. (BOT)'; }			}		}	} }