Jump to content

User:Yobot/Film

From Wikipedia, the free encyclopedia
private static readonly Regex WPFilm = Tools.NestedTemplateRegex(new List<string>("WikiProject Film".Split(',')));
public string ProcessArticle(string ArticleText, string ArticleTitle, int wikiNamespace, out string Summary, out bool Skip)
{
	Skip = false;
	Summary = "Standardise WPFilm work group parameters";

	foreach(Match m in WPFilm.Matches(ArticleText))
	{
		string newValue = m.Value;

		newValue = Tools.RenameTemplateParameter(newValue, "mexican", "Mexican-task-force");
		newValue = Tools.RenameTemplateParameter(newValue, "documentary", "Documentary-film-task-force");
		newValue = Tools.RenameTemplateParameter(newValue, "silent", "Silent-film-task-force");

               if(Tools.GetTemplateParameterValue(newValue, "Silent").Length + Tools.GetTemplateParameterValue(newValue, "Silent-task-force").Length == 0)
               {
                  newValue = Tools.SetTemplateParameterValue(newValue,"Silent","yes");
               }

		ArticleText = ArticleText.Replace(m.Value, newValue);
	}
	return ArticleText;
}