/* * To change this template, choose Tools | Templates * and open the template in the editor. */packagewikibookbot;importnet.wikipedia.Wiki;/** * * @author Base */publicclassWikiBookBot{/** * @param args the command line arguments * @throws Exception */publicstaticvoidmain(String[]args)throwsException{Wikiwiki=newWiki("uk.wikibooks.org");//укрвікіwiki.login("Login","password");//вхід в ВПwiki.setMarkBot(true);wiki.setMarkMinor(true);//allPages(String title, int namespace, boolean redirects)doing(wiki,"");wiki.logout();//Виходимо з ВП}publicstaticvoiddoing(Wikiwiki,Stringpage)throwsException{String[]ap=wiki.allPages(page,Wiki.ALL_NAMESPACES,false);Stringpt;for(inti=0;i<ap.length;i++){Stringtap=ap[i];pt=wiki.getPageText(tap);Thread.sleep(1000);pt.replaceAll("Пориньте у Python 3","Пориньте у Python 3");pt=pt.replaceAll("\\[\\[File:","[[Файл:");pt=pt.replaceAll("\\[\\[Зображення:","[[Файл:");pt=pt.replaceAll("\\[\\[Image:","[[Файл:");pt=pt.replaceAll("\\[\\[Category:","[[Категорія:");wiki.edit(tap,pt,"Локалізовані префікси, перейменування занурення в пітон 3");Thread.sleep(1000);if(i==ap.length-1){doing(wiki,tap);}else{}}}}