DotNetWikiBot

程序名称:DotNetWikiBot

授权协议: MIT

操作系统: Windows

开发语言: C#

DotNetWikiBot 介绍

DotNetWikiBot Framework 是一个功能的客户端API和一个控制台应用,用来构建抓取基于
MediaWiki 网站的爬虫,采用 .NET 开发。

示例代码

using DotNetWikiBot;    // Reference DotNetWikiBot namespace for easy access

class MyBot : Bot   // Derive your bot class from framework's Bot class  
{  
    public static void Main()  
    {  
        // Firstly make Site object, specifying site's URL and your bot account  
        Site enWiki = new Site("http://en.wikipedia.org", "myBotLogin", "myPassword");  
        // Then make Page object, specifying site and page title in constructor  
        Page p = new Page(enWiki, "Art");  
        // Load actual page text from live wiki  
        p.Load();  
        // Add "Visual arts" category link to "Art" page's text  
        p.AddToCategory("Visual arts");  
        // Save "Art" article's text back to live wiki with specified comment  
        p.Save("comment: category link added", true);

        // Make empty Pagelist object, representing collection of pages  
        Pagelist pl = new Pagelist(enWiki);  
        // Fill it with 100 pages, where "nuclear disintegration" is mentioned  
        pl.FillFromGoogleSearchResults("nuclear disintegration", 100);  
        // Load texts and Metadata of all found pages from live wiki  
        pl.LoadEx();  
        // Now suppose, that we must correct some typical mistake in all our pages  
        foreach (Page i in pl)  
            // In each page we will replace one phrase with another  
            i.text = i.text.Replace("fusion products", "fission products");  
        // Finally we'll save all changed pages to wiki with 5 seconds interval           
        pl.SaveSmoothly(5, "comment: mistake autocorrection", true);

        // Now clear our Pagelist so we Could re-use it  
        pl.Clear();  
        // Fill it with all articles in "Astronomy" category and it's subcategories  
        pl.FillFromCategoryTree("Astronomy");  
        // Download and save all Pagelist's articles to specified local XML file  
        pl.SaveXMLDumpToFile("Dumps\\ArticlesAboutAstronomy.xml");        
    }  
}

DotNetWikiBot 官网

http://dotnetwikibot.sourceforge.net/

相关编程语言

Pacman 是一个软件包管理器, 作为 ArchLinux 发行版...
Smb4K 是KDE下的网络共享浏览器 更多屏幕截图请看:...
Wine (“Wine Is Not an Emulator” 的首字母缩写)...
虚拟桌面软件,可管理最多9个虚拟桌面,你可以用热键...
UNetbootin (Universal Netboot Installer)为一种跨...
Cobbler 可以用来快速建立 Linux 网络安装环境,它已...