Jump to content
MediaWiki

Manual:Pywikibot/basic.py

From mediawiki.org
Wikimedia Git repository has this file: scripts/basic.py
Pywikibot logo
Pywikibot scripts
  • Configuration and scripts
  • Uses
More... »
v · d · e

basic.py is a script of the Pywikibot framework. It is not a complete bot; rather, it is a template from which simple bots can be made. You can rename it to mybot.py, then edit it in whatever way you want.

Parameters

[edit ]

The following parameters are supported:

-always The bot won't ask for confirmation when putting a page.
-text: Use this text to be added; otherwise 'Test' is used.
-replace Don't add text but replace it.
-top Place additional text on top of the page.
-summary: Set the action summary message for the edit.

All page generator/filter options supported by pywikibot.pagegenerators are also supported, e.g., -recentpages: and -page:.

Use global -simulate option for test purposes. No changes are made to the live wiki if this option is supplied.

Example

[edit ]
$ pythonpwb.pybasic-simulate-page:User:MyUserName
This tries to append "Text" to the page User:MyUserName. Since the -simulate option is given, the actual page on the live wiki won't be modified.

AltStyle によって変換されたページ (->オリジナル) /