Difference between revisions of "SMWConTalk2020-04"
Jump to navigation
Jump to search
Line 64: | Line 64: | ||
== ⌘⌘ py-3rdpart-mediawiki == | == ⌘⌘ py-3rdpart-mediawiki == | ||
* https://test.pypi.org/project/py-3rdparty-mediawiki/ | * https://test.pypi.org/project/py-3rdparty-mediawiki/ | ||
+ | <source lang='python'> | ||
+ | from wikibot.wikibot import WikiBot | ||
+ | wikibot=WikiBot.ofWikiId("test2") | ||
+ | wikibot.site .. | ||
+ | </source> |
Revision as of 15:42, 2 April 2020
<slideshow style="bitplan" headingmark="⌘⌘" incmark="…" scaled="true" font="Comic Sans MS, Calibri, cursive" >
- title
Push
your wikifarm pages
with
encrypted credential handling
- author
Wolfgang Fahl info@bitplan.com- footer
- Lightning Talk
- subfooter
- EMW Con 2020
</slideshow>
⌘⌘ MediaWiki API
- The MediaWiki API allows manipulating your Wiki automatically
There are many implementations for different languages e.g.
Language | Project | By |
---|---|---|
Java | MediaWiki-Japi | BITPlan |
Python | pywikbot | WikiMedia Foundation |
JavaScript | nodemw | Maciej Brencz |
⌘⌘ Dragtop Example
The Dragtop prototype shows how automation could be simplified. A main showstopper on the way to this is how to make the credentials available for the automation without interfering the user experience.
⌘⌘ Encrypted credential storage
- http://mediawiki-japi.bitplan.com/index.php/CommandLine tries simplifying setting up an encrypted INI file
#Mediawiki JAPI credentials for test2
#Mon Mar 16 08:09:44 CET 2020
url=http://test.bitplan.com
cypher=...
scriptPath=
secret=...
user=wf
salt=...
wikiId=test
version=MediaWiki 1.27.3
email=wf@bitplan.com
⌘⌘ Derived pywikibot family file
Note that the password is NOT included and the password clear text feature of pywikibot is NOT used
# -*- coding: utf-8 -*-
from pywikibot import family
class Family(family.Family):
name = 'test'
langs = {
'en': 'test.bitplan.com',
}
def scriptpath(self, code):
return ''
def isPublic(self):
return False
def version(self, code):
return "1.27.3" # The MediaWiki version used. Very important in most cases. (contrary to documentation)
def protocol(self, code):
return 'http'
⌘⌘ py-3rdpart-mediawiki
from wikibot.wikibot import WikiBot
wikibot=WikiBot.ofWikiId("test2")
wikibot.site ..