User:Slaporte/GSoC2010/USCodeTool

From Wikisource
Jump to navigation Jump to search

This tool processes a title of the United States Code for bot upload.

Input[edit]

Specify the input file in ?u= in the URL. This script is designed to process the U.S. Code in HTML format available from the GPO. You can download these files from http://www.gpo.gov/fdsys/browse/collectionUScode.action?collectionCode=USCODE.

For example: FDSysCode.php?u=http://www.gpo.gov/fdsys/pkg/USCODE-2009-title1/html/USCODE-2009-title1.htm

Output[edit]

Each section, and the main page for each title, subtitle, chapter, subchapter, and part is formatted as a separate page, beginning with {{-start-}} and ending with {{-stop-}}.

The pages can be added to Wikisource using pywikipediabot's pagefromfile.py. Use the -notitle option to avoid including the page name in each article. More information on pywikipediabot and pagefromfile.py is available at http://pywikipediabot.sourceforge.net/ and http://meta.wikimedia.org/wiki/Pywikipediabot/pagefromfile.py.

Necessary templates[edit]

More information on templates, formatting, and style for the United States Code is available at Wikisource:WikiProject US Code.