Manual:Pywikibot/basic.py
From Linux Web Expert
File:Git icon.svg | <translate> Wikimedia [[<tvar|1>Special:MyLanguage/Gerrit</>|Git repository]] has this file:</translate> scripts/basic.py |
File:Pywikibot MW gear icon.svg |
<translate> Pywikibot scripts</translate> |
---|
|
· <span style="" title="<translate nowrap> Edit this template</translate>"><translate> e</translate> |
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
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
$ python pwb.py basic -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.