Vikipedi:VikiProje Madde Değerlendirmesi/Menü Güncellemesi

Vikipedi, özgür ansiklopedi

Menü Güncellemelerinin otomatik olarak yapılması.

using System;
using System.IO;
using System.Text;
using System.Text.RegularExpressions;
using System.Collections;
using System.Xml;
using DotNetWikiBot;

class MyBot : Bot
{
        public void MyFunction1()
        {
                // Write your own function here
        }
        
        /// The entry point function. Start coding here.
    public static void Main()
    {
            // Here are some code examples:
            Site site = new Site("http://tr.wikipedia.org", "", "");
        string[] groups = {"AA","BA","CA","DA","GA","TA","İA","ZA", 
            "AB","BB","CB","DB","GB","TB","İB","ZB", 
            "AC","BC","CC","DC","GC","TC","İC","ZC",
            "AD","BD","CD","DD","GD","TD","İD","ZD",
            "A","B","C","D","G","T","İ","Z"};
        string[] birimler = {"A sınıfı","B sınıfı","C sınıfı","D sınıfı",
            "G sınıfı","T sınıfı","Öncelik değerli","Yüksek değerli", 
            "Orta değerli","Düşük değerli"};
        PageList pl = new PageList(site);
        PageList plall = new PageList(site);
        Page p = new Page(site, "Kategori:Madde Değerlendirmesi");
        p.LoadEx();
        if (p.Exists()) Console.WriteLine(p.text);
        p.text = "{{Madde Değerlendirmesi";
        foreach (string b in birimler)
        {
            pl.FillAllFromCategory("Kategori:" + b);
            foreach (Page i in pl.pages)
                plall.FillFromCategory(i.title);
            p.text = p.text + "\n|" + b + "=" + plall.pages.Count;
            plall.Clear();
        }
        p.text = p.text + "}}";

//        foreach (string pi in projeler)
//        {
            p.text = p.text + "{{Değerlendirme Uzayı";
            foreach (string i in groups)
            {
                plall.FillFromCategory(i + "-Askeriye");
                p.text = p.text + "\n|" + i + "=" + plall.pages.Count;
                plall.Clear();
            }
            p.text = p.text + "\n}}";
//        }
    }
}