ویکیپدیا:ویرایشگر خودکار/ابرابزار/ماژول
در منوی Tools به Make Module بروید و کدی که در انتهای این نوشته آمده است را در پنجرهٔ پایین صفحه درج کنید. سپس enabled را تیک بزنید و بر make module کلیک کنید. سپس Close را بزنید تا پنجره بسته شود.
نکته ۲:برای اینکه هر دفعه نیاز نباشد ماژول را فعال کنید بعد از کپیکردن ماژول و تغییر آدرس در بخش file دکمهٔ save settings را بزنید تا هر زمان که ویرایشگر خودکار را باز کردید ماژول برای شما فعال باشد.
کد ماژول
[ویرایش]public string ProcessArticle(string ArticleText, string ArticleTitle, int wikiNamespace, out string Summary, out bool Skip)
{
string OrigText = ArticleText;
Skip = false;
Summary = "[[وپ:ابرابزار|+ ویرایش با ماژول ابرابزار]] ";
try
{
System.Diagnostics.Process process = new System.Diagnostics.Process();
System.Diagnostics.ProcessStartInfo psi = new System.Diagnostics.ProcessStartInfo();
psi.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
psi.FileName = "node";
psi.Arguments = "fa_bot.js";
using (System.IO.StreamWriter writer = new System.IO.StreamWriter("io.txt"))
writer.Write(ArticleText);
System.Diagnostics.Process p = System.Diagnostics.Process.Start(psi);
p.WaitForExit();
if (System.IO.File.Exists("io.txt"))
{
using (System.IO.StreamReader reader = System.IO.File.OpenText("io.txt"))
ArticleText = reader.ReadToEnd();
if (ArticleText == OrigText)
Skip = true;
}
else
Skip = true;
return ArticleText;
}
catch
{
Skip = true;
return OrigText;
}
}
Text is available under the CC BY-SA 4.0 license; additional terms may apply.
Images, videos and audio are available under their respective licenses.