Difference between revisions of "SMWConTalk2020-04"

From BITPlan Wiki
Jump to navigation Jump to search
 
(6 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<br> wikifarm pages with<br>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>
Line 39: Line 40:
 
</source>
 
</source>
 
== ⌘⌘ Push pages example ==
 
== ⌘⌘ 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'>
 
<source lang='bash' highlight='1'>
 
./run -l -s master -t test -p Training
 
./run -l -s master -t test -p Training
Line 88: Line 91:
 
       return 'http'
 
       return 'http'
 
</source>
 
</source>
== ⌘⌘ py-3rdpart-mediawiki ==
+
== ⌘⌘ py-3rdparty-mediawiki ==
* https://test.pypi.org/project/py-3rdparty-mediawiki/
+
* https://pypi.org/project/py-3rdparty-mediawiki/
 
<source lang='python'>
 
<source lang='python'>
 
from wikibot.wikibot import WikiBot
 
from wikibot.wikibot import WikiBot
Line 95: Line 98:
 
wikibot.site ..
 
wikibot.site ..
 
</source>
 
</source>
 +
[[Category:frontend]]

Latest revision as of 14:42, 19 April 2023

view SMWConTalk2020-04 as slides

<slideshow style="bitplan" headingmark="⌘⌘" incmark="…" scaled="true" font="Comic Sans MS, Calibri, cursive" >

title
WolfgangFahl.png

Push your
wikifarm pages with
encrypted credential handling
author

Wolfgang Fahl info@bitplan.com
footer
Lightning Talk
subfooter
EMW Con 2020

</slideshow>

⌘⌘ MediaWiki API

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

#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

Picturetestpage.png

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 ..