Difference between revisions of "SMWConTalk2020-04"
Jump to navigation
Jump to search
(26 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | {{PageSequence|prev=Build Your Own Self Driving Vehicle with Java|category=talk|categoryIcon=picture-o}} | + | {{PageSequence|prev=Build Your Own Self Driving Vehicle with Java|next=Mediawiki 1.35 Migration|category=talk|categoryIcon=picture-o}}{{ShowSlides}} |
+ | |||
<slideshow style="bitplan" headingmark="⌘⌘" incmark="…" scaled="true" font="Comic Sans MS, Calibri, cursive" > | <slideshow style="bitplan" headingmark="⌘⌘" incmark="…" scaled="true" font="Comic Sans MS, Calibri, cursive" > | ||
− | ;title: [[File:WolfgangFahl.png|200px|left|link=https://www.semantic-mediawiki.org/wiki/User:WolfgangFahl]]<br><span style='font-size:150%'>Push your wikifarm pages with encrypted credential handling </span> | + | ;title: [[File:WolfgangFahl.png|200px|left|link=https://www.semantic-mediawiki.org/wiki/User:WolfgangFahl]]<br><span style='font-size:150%'>Push your<br> wikifarm pages with<br>encrypted credential handling </span> |
;author: <span style='font-size:50%'><br> [https://www.semantic-mediawiki.org/wiki/User:WolfgangFahl Wolfgang Fahl] [mailto:info@bitplan.com info@bitplan.com]</span> | ;author: <span style='font-size:50%'><br> [https://www.semantic-mediawiki.org/wiki/User:WolfgangFahl Wolfgang Fahl] [mailto:info@bitplan.com info@bitplan.com]</span> | ||
;footer: Lightning Talk | ;footer: Lightning Talk | ||
Line 7: | Line 8: | ||
</slideshow> | </slideshow> | ||
== ⌘⌘ MediaWiki API == | == ⌘⌘ MediaWiki API == | ||
+ | * The [https://www.mediawiki.org/wiki/API:Main_page MediaWiki API] allows manipulating your Wiki automatically | ||
+ | There are [https://www.mediawiki.org/wiki/API:Client_code many implementations] for different languages e.g. | ||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | ! Language !! Project !! By | ||
+ | |- | ||
+ | | Java || [http://mediawiki-japi.bitplan.com/index.php/Main_Page MediaWiki-Japi] || [http://www.bitplan.com BITPlan] | ||
+ | |- | ||
+ | | Python || [https://github.com/wikimedia/pywikibot pywikbot] || [https://wikimediafoundation.org/ WikiMedia Foundation] | ||
+ | |- | ||
+ | | JavaScript || [https://github.com/macbre/nodemw nodemw] || [https://github.com/macbre Maciej Brencz] | ||
+ | |} | ||
+ | |||
+ | == ⌘⌘ Dragtop Example == | ||
+ | The [http://www.bitplan.com/index.php/Dragtop 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 | ||
+ | <source lang='bash'> | ||
+ | #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 | ||
+ | </source> | ||
+ | == ⌘⌘ Push pages example == | ||
+ | [[File:picturetestpage.png|link=https://test.wikipedia.org/wiki/PictureTestPage|800px|right]] | ||
+ | see also https://test.wikipedia.org/wiki/PictureTestPage | ||
+ | <source lang='bash' highlight='1'> | ||
+ | ./run -l -s master -t test -p Training | ||
+ | Apr 02, 2020 4:46:32 PM com.bitplan.mediawiki.japi.SSLWiki login | ||
+ | INFORMATION: http://master.bitplan.com/api.php?:Success | ||
+ | Apr 02, 2020 4:46:33 PM com.bitplan.mediawiki.japi.SSLWiki login | ||
+ | INFORMATION: http://test.bitplan.com/api.php?:Success | ||
+ | File:Book open2.png | ||
+ | http://master.bitplan.com/images/master/9/92/Book_open2.png | ||
+ | File:Bookicon.png | ||
+ | http://master.bitplan.com/images/master/2/23/Bookicon.png | ||
+ | File:Cr icon.png | ||
+ | http://master.bitplan.com/images/master/e/e8/Cr_icon.png | ||
+ | File:Graduate.png | ||
+ | http://master.bitplan.com/images/master/8/8a/Graduate.png | ||
+ | File:QuizcardIcon.png | ||
+ | http://master.bitplan.com/images/master/b/b8/QuizcardIcon.png | ||
+ | File:Traininglocation.png | ||
+ | http://master.bitplan.com/images/master/b/b1/Traininglocation.png | ||
+ | File:Users2.png | ||
+ | http://master.bitplan.com/images/master/6/6d/Users2.png | ||
+ | File:ZAnswerIcon.png | ||
+ | http://master.bitplan.com/images/master/6/64/ZAnswerIcon.png | ||
+ | File:ZQuestionIcon.png | ||
+ | http://master.bitplan.com/images/master/d/d5/ZQuestionIcon.png | ||
+ | </source> | ||
+ | |||
+ | == ⌘⌘ Derived pywikibot family file == | ||
+ | Note that the password is '''NOT''' included and the password clear text feature of pywikibot is '''NOT''' used | ||
+ | <source lang='python'> | ||
+ | # -*- 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' | ||
+ | </source> | ||
+ | == ⌘⌘ py-3rdparty-mediawiki == | ||
+ | * https://pypi.org/project/py-3rdparty-mediawiki/ | ||
+ | <source lang='python'> | ||
+ | from wikibot.wikibot import WikiBot | ||
+ | wikibot=WikiBot.ofWikiId("test2") | ||
+ | wikibot.site .. | ||
+ | </source> | ||
+ | [[Category:frontend]] |
Latest revision as of 13:42, 19 April 2023
view SMWConTalk2020-04 as slides
<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
⌘⌘ Push pages example
see also https://test.wikipedia.org/wiki/PictureTestPage
./run -l -s master -t test -p Training
Apr 02, 2020 4:46:32 PM com.bitplan.mediawiki.japi.SSLWiki login
INFORMATION: http://master.bitplan.com/api.php?:Success
Apr 02, 2020 4:46:33 PM com.bitplan.mediawiki.japi.SSLWiki login
INFORMATION: http://test.bitplan.com/api.php?:Success
File:Book open2.png
http://master.bitplan.com/images/master/9/92/Book_open2.png
File:Bookicon.png
http://master.bitplan.com/images/master/2/23/Bookicon.png
File:Cr icon.png
http://master.bitplan.com/images/master/e/e8/Cr_icon.png
File:Graduate.png
http://master.bitplan.com/images/master/8/8a/Graduate.png
File:QuizcardIcon.png
http://master.bitplan.com/images/master/b/b8/QuizcardIcon.png
File:Traininglocation.png
http://master.bitplan.com/images/master/b/b1/Traininglocation.png
File:Users2.png
http://master.bitplan.com/images/master/6/6d/Users2.png
File:ZAnswerIcon.png
http://master.bitplan.com/images/master/6/64/ZAnswerIcon.png
File:ZQuestionIcon.png
http://master.bitplan.com/images/master/d/d5/ZQuestionIcon.png
⌘⌘ 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-3rdparty-mediawiki
from wikibot.wikibot import WikiBot
wikibot=WikiBot.ofWikiId("test2")
wikibot.site ..