Python-wikitools: http://code.google.com/p/python-wikitools/
There are three modules that I often use, i.e. wiki, page and api. In the beginning of python script, it is required to import these three modules.
from wikitools import wiki from wikitools import page from wikitools import api
To access the MediaWiki, we need to create Wiki object.
myWiki = wiki.Wiki('http://my.wikisite.org/w/api.php')
If I want to get a page information, I can create a WIKI page object. Then, I can get the information by the method, "getWikiText()".
wikiPage = page.Page(myWiki, title) wikiText = wikiPage.getWikiText()
Limitations:
Can only do what MediaWiki API can do.
沒有留言:
發佈留言