Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- STDOUT:
- Global arguments available for all bots:
- -dir:PATH Read the bot's configuration data from directory given by
- PATH, instead of from the default directory.
- -lang:xx Set the language of the wiki you want to work on, overriding
- the configuration in user-config.py. xx should be the
- language code.
- -family:xyz Set the family of the wiki you want to work on, e.g.
- wikipedia, wiktionary, wikitravel, ...
- This will override the configuration in user-config.py.
- -user:xyz Log in as user 'xyz' instead of the default username.
- -daemonize:xyz Immediately return control to the terminal and redirect
- stdout and stderr to xyz (only use for bots that require
- no input from stdin).
- -help Show this help text.
- -log Enable the logfile, using the default filename
- "category.log"
- Logs will be stored in the logs subdirectory.
- -log:xyz Enable the logfile, using 'xyz' as the filename.
- -nolog Disable the logfile (if it is enabled by default).
- -loghandler:xyz Choose a value for 'xyz' from 'TRFH' (TimedRotatingFile-
- Handler) or 'RFH' (RotatingFileHandler). Has to be defined
- before '-log' on command line.
- -maxlag Sets a new maxlag parameter to a number of seconds. Defer bot
- edits during periods of database server lag. Default is set by
- config.py
- -putthrottle:n Set the minimum time (in seconds) the bot will wait between
- -pt:n saving pages.
- -verbose Have the bot provide additional output that may be
- -v useful in debugging.
- -cosmeticchanges Toggles the cosmetic_changes setting made in config.py or
- -cc user_config.py to its inverse and overrules it. All other
- settings and restrictions are untouched.
- -simulate Disables writing to the server. Useful for testing and
- debugging of new code (if given, doesn't do any real
- changes, but only shows what would have been changed).
- STDOUT:
- Scripts to manage categories.
- Syntax: python category.py action [-option]
- where action can be one of these:
- * add - mass-add a category to a list of pages
- * remove - remove category tag from all pages in a category
- * move - move all pages in a category to another category
- * tidy - tidy up a category by moving its articles into subcategories
- * tree - show a tree of subcategories of a given category
- * listify - make a list of all of the articles that are in a category
- and option can be one of these:
- Options for "add" action:
- * -person - sort persons by their last name
- * -create - If a page doesn't exist, do not skip it, create it instead
- * -redirect - Follow redirects
- If action is "add", the following options are supported:
- -cat Work on all pages which are in a specific category.
- Argument can also be given as "-cat:categoryname" or
- as "-cat:categoryname|fromtitle" (using # instead of |
- is also allowed in this one and the following)
- -catr Like -cat, but also recursively includes pages in
- subcategories, sub-subcategories etc. of the
- given category.
- Argument can also be given as "-catr:categoryname" or
- as "-catr:categoryname|fromtitle".
- -subcats Work on all subcategories of a specific category.
- Argument can also be given as "-subcats:categoryname" or
- as "-subcats:categoryname|fromtitle".
- -subcatsr Like -subcats, but also includes sub-subcategories etc. of
- the given category.
- Argument can also be given as "-subcatsr:categoryname" or
- as "-subcatsr:categoryname|fromtitle".
- -uncat Work on all pages which are not categorised.
- -uncatcat Work on all categories which are not categorised.
- -uncatfiles Work on all files which are not categorised.
- -uncattemplates Work on all templates which are not categorised.
- -file Read a list of pages to treat from the named text file.
- Page titles in the file must be enclosed with [[brackets]]
- or separated by newlines. Argument can also be given as
- "-file:filename".
- -filelinks Work on all pages that use a certain image/media file.
- Argument can also be given as "-filelinks:filename".
- -search Work on all pages that are found in a MediaWiki search
- across all namespaces.
- -namespace Filter the page generator to only yield pages in the
- -ns specified namespaces. Separate multiple namespace numbers
- with commas. Example: -ns:"0,2,4" (Take care of quotation
- marks as comma may qualify as command line separator.)
- Will ask for namespaces if you write just -namespace or -ns.
- -interwiki Work on the given page and all equivalent pages in other
- languages. This can, for example, be used to fight
- multi-site spamming.
- Attention: this will cause the bot to modify
- pages on several wiki sites, this is not well tested,
- so check your edits!
- -limit:n When used with any other argument that specifies a set
- of pages, work on no more than n pages in total
- -links Work on all pages that are linked from a certain page.
- Argument can also be given as "-links:linkingpagetitle".
- -imagelinks Work on all images that are linked from a certain page.
- Argument can also be given as "-imagelinks:linkingpagetitle".
- -newimages Work on the 100 newest images. If given as -newimages:x,
- will work on the x newest images.
- -new Work on the 60 recent new pages. If given as -new:x,
- will work on the x newest pages.
- -recentchanges Work on new and edited pages returned by
- [[Special:Recentchanges]]. Can also be given as
- "-recentchanges:n" where n is the number of pages to be
- returned, else 100 pages are returned.
- -rc-nobots Same as above but doesn't work on pages that bots have edited
- -ref Work on all pages that link to a certain page.
- Argument can also be given as "-ref:referredpagetitle".
- -start Specifies that the robot should go alphabetically through
- all pages on the home wiki, starting at the named page.
- Argument can also be given as "-start:pagetitle".
- You can also include a namespace. For example,
- "-start:Template:!" will make the bot work on all pages
- in the template namespace.
- -prefixindex Work on pages commencing with a common prefix.
- -titleregex Work on titles that match the given regular expression.
- -transcludes Work on all pages that use a certain template.
- Argument can also be given as "-transcludes:Title".
- -unusedfiles Work on all description pages of images/media files that are
- not used anywhere.
- Argument can be given as "-unusedfiles:n" where
- n is the maximum number of articles to work on.
- -unwatched Work on all articles that are not watched by anyone.
- Argument can be given as "-unwatched:n" where
- n is the maximum number of articles to work on.
- -usercontribs Work on articles that were edited by a certain user.
- Example: -usercontribs:DumZiBoT
- Normally up to 250 distinct pages are given. To get an other
- number of pages, add the number behind the username
- delimited with ";"
- Example: -usercontribs:DumZiBoT;500
- returns 500 distinct pages to work on.
- -<mode>log Work on articles that were on a specified special:log.
- You have options for every type of logs given by the
- <mode> parameter which could be one of the following:
- block, protect, rights, delete, upload, move, import,
- patrol, merge, suppress, review, stable, gblblock,
- renameuser, globalauth, gblrights, abusefilter, newusers
- Examples:
- -movelog gives 500 pages from move log (should be redirects)
- -deletelog:10 gives 10 pages from deletion log
- -protect:Dummy gives 500 pages from protect by user Dummy
- -patrol:Dummy;20 gives 20 pages patroled by user Dummy
- In some cases this must be written as -patrol:"Dummy;20"
- -weblink Work on all articles that contain an external link to
- a given URL; may be given as "-weblink:url"
- -withoutinterwiki Work on all pages that don't have interlanguage links.
- Argument can be given as "-withoutinterwiki:n" where
- n is some number (??).
- -random Work on random pages returned by [[Special:Random]].
- Can also be given as "-random:n" where n is the number
- of pages to be returned, otherwise the default is 10 pages.
- -randomredirect Work on random redirect pages returned by
- [[Special:RandomRedirect]]. Can also be given as
- "-randomredirect:n" where n is the number of pages to be
- returned, else 10 pages are returned.
- -gorandom Specifies that the robot should starting at the random pages
- returned by [[Special:Random]].
- -redirectonly Work on redirect pages only, not their target pages.
- The robot goes alphabetically through all redirect pages
- on the wiki, starting at the named page. The
- argument can also be given as "-redirectonly:pagetitle".
- You can also include a namespace. For example,
- "-redirectonly:Template:!" will make the bot work on
- all redirect pages in the template namespace.
- -google Work on all pages that are found in a Google search.
- You need a Google Web API license key. Note that Google
- doesn't give out license keys anymore. See google_key in
- config.py for instructions.
- Argument can also be given as "-google:searchstring".
- -yahoo Work on all pages that are found in a Yahoo search.
- Depends on python module pYsearch. See yahoo_appid in
- config.py for instructions.
- -page Work on a single page. Argument can also be given as
- "-page:pagetitle".
- Options for "listify" action:
- * -overwrite - This overwrites the current page with the list even if
- something is already there.
- * -showimages - This displays images rather than linking them in the list.
- * -talkpages - This outputs the links to talk pages of the pages to be
- listified in addition to the pages themselves.
- Options for "remove" action:
- * -nodelsum - This specifies not to use the custom edit summary as the
- deletion reason. Instead, it uses the default deletion reason
- for the language, which is "Category was disbanded" in
- English.
- Options for "move" action:
- * -hist - Creates a nice wikitable on the talk page of target category
- that contains detailed page history of the source category.
- * -nodelete - Don't delete the old category after move
- Options for several actions:
- * -rebuild - reset the database
- * -from: - The category to move from (for the move option)
- Also, the category to remove from in the remove option
- Also, the category to make a list of in the listify option
- * -to: - The category to move to (for the move option)
- - Also, the name of the list to make in the listify option
- NOTE: If the category names have spaces in them you may need to use
- a special syntax in your shell so that the names aren't treated as
- separate parameters. For instance, in BASH, use single quotes,
- e.g. -from:'Polar bears'
- * -batch - Don't prompt to delete emptied categories (do it
- automatically).
- * -summary: - Pick a custom edit summary for the bot.
- * -inplace - Use this flag to change categories in place rather than
- rearranging them.
- * -recurse - Recurse through all subcategories of categories.
- * -pagesonly - While removing pages from a category, keep the subpage links
- and do not remove them
- * -match - Only work on pages whose titles match the given regex (for
- move and remove actions).
- For the actions tidy and tree, the bot will store the category structure
- locally in category.dump. This saves time and server load, but if it uses
- these data later, they may be outdated; use the -rebuild parameter in this
- case.
- For example, to create a new category from a list of persons, type:
- python category.py add -person
- and follow the on-screen instructions.
- Or to do it all from the command-line, use the following syntax:
- python category.py move -from:US -to:'United States'
- This will move all pages in the category US to the category United States.
- D:\Python 27 new Compat\compat>
Advertisement
Add Comment
Please, Sign In to add comment