There are at least two different scenarios for creating new pages in Wikimedia:
For the first scenario, you can use the CSVLoader plugin developed by Ganeshk - assuming that you have a CSV data file with the basic pieces of information that you need to assemble in articles. Step by step tutorial for creating pages this way you can find at Wiki: CSVLoader/Walkthrough.
For the second scenario you can follow the walkthrough below. The procedure described here uses a custom batch script that passes to AutoWikiBrowser the generated content for each article, using the External Processing option.
In order to import pages generated from a 3rd party program into Wikipedia using AWB, you need:
You need a file with the list of article names to be created. The text file with the list should be also saved in UTF-8 format if it contains non-English characters.
If you don't have this list generated by an external tool, you can build it by opening a Command prompt console in the folder where you have the article files and type:
chcp 65001 for %i in (*.txt) do @echo %~ni >> AWBlist.txt
Maybe you should run this code directly in the console if it doesn't work. To do this, open the console in the current folder (SHIFT + right click and select "Open console"), and type the code above.
In the folder where AWB is installed, create a batch script file with the name script.bat and with the following content:
@echo off chcp 65001 setlocal enableextensions enabledelayedexpansion set concat= for %%x in (%*) do set concat=!concat! %%x set concat=%concat:~1% copy /Y "C:\_folder_with_my_files_\%concat%.txt" iofile.txt echo %concat% >> log.txt
Make sure that you replace _folder_with_my_files_ with the actual folder name where you have stored the article text files.
What the script does:
You can use the batch script above as it is, but this will briefly open a Windows Console window at each article, that steals the focus. In order to avoid this, we must instruct the AWB to run the script in background.
So create a shortcut to script.bat in the same folder where AWB is installed (just drag script.bat with the right mouse button in a n empty space in the folder, then choose Create shortcut here). Then change the properties of the script - Shortcut.lnk file so that it runs minimized (right-click on it and choose Properties, then change the Run option from Normal Window to Minimized).
After you start AWB, go to menu Tools -> External processing. In the dialog window enter:
C:\_awb_folder_\script - Shortcut.lnk
)C:\_awb_folder_\iofile.txt
In order to load in AWB the list of articles to be imported, you need to use the list that you created in the first step.
In Make list Panel, choose Source: Text file (UTF-8), then click on Make list. Choose the AWBlist.txt file that you have generated. The list of articles should be imported in the panel below.
Other settings:
Then click Start and off you go.
AWB allows to create a C# module in order to find files while processing pages. They are different steps:
The easiest way to upload pages from your computer is to group all the source pages in the same folder, and to create a list where each article name is the same as the file name. When the list is ready, open AWB and select Make list, Source, Text file (both UTF-8 and Windows 1252 / ANSI works). Then select the file containing the list.
Next you will have to load a custom module. Each time an article in the list is loaded, the module will be called, then he has to find the file corresponding to the article's name, and return the text to add. Here is an example of module selecting the file from "C://files/", and returning the result.
Click on Tools, Make module and copy/paste the following code :
public string ProcessArticle(string ArticleText, string ArticleTitle, int wikiNamespace, out string Summary, out bool Skip) { Skip = false; // Useful to edit the text with modifying the source file string text = ""; Summary = ""; try { text = System.IO.File.ReadAllText(@"C:\\files\" + ArticleTitle + ".txt"); Summary = "page successfully created."; } catch { // Do something when page was not properly created } // Eventually we return the result return text; }
In the module's window click on Make module and check Enabled. Then come back on the main window and click Start.
This article uses material from the Wikipedia English article Create new pages, which is released under the Creative Commons Attribution-ShareAlike 3.0 license ("CC BY-SA 3.0"); additional terms may apply (view authors). Content is available under CC BY-SA 4.0 unless otherwise noted. Images, videos and audio are available under their respective licenses.
®Wikipedia is a registered trademark of the Wiki Foundation, Inc. Wiki English (DUHOCTRUNGQUOC.VN) is an independent company and has no affiliation with Wiki Foundation.