Created
February 9, 2009 15:11
-
-
Save olleolleolle/60818 to your computer and use it in GitHub Desktop.
Here is a sample usage of the mwclient API (MediaWiki used with Python)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import mwclient | |
username = u'WikiSysop' | |
password = u's3cr3t' | |
#site = mwclient.Site(('https', host), path = '/mediawiki-1.14.0rc1/') | |
host = u'tools' | |
site = mwclient.Site(host, path=u'/mediawiki-1.14.0rc1/') | |
site.login(username, password) | |
# Edit page | |
appname = u"Spencer Johnson and Co." | |
pagename = u'Automatic Export of %s' % (appname) | |
page = site.Pages[pagename] | |
text = page.edit() | |
print 'Text in sandbox:', text.encode('utf-8') | |
page.save(text + u'\nGetting more and better complex.', summary = 'Auto-export.') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment