|
@@ -7,12 +7,12 @@ Integration |
|
|
:py:func:`mwparserfromhell.parse() <mwparserfromhell.__init__.parse>` on |
|
|
:py:func:`mwparserfromhell.parse() <mwparserfromhell.__init__.parse>` on |
|
|
:py:meth:`~earwigbot.wiki.page.Page.get`. |
|
|
:py:meth:`~earwigbot.wiki.page.Page.get`. |
|
|
|
|
|
|
|
|
If you're using PyWikipedia_, your code might look like this:: |
|
|
|
|
|
|
|
|
If you're using Pywikipedia_, your code might look like this:: |
|
|
|
|
|
|
|
|
import mwparserfromhell |
|
|
import mwparserfromhell |
|
|
import wikipedia as pywikibot |
|
|
import wikipedia as pywikibot |
|
|
def parse(title): |
|
|
def parse(title): |
|
|
site = pywikibot.get_site() |
|
|
|
|
|
|
|
|
site = pywikibot.getSite() |
|
|
page = pywikibot.Page(site, title) |
|
|
page = pywikibot.Page(site, title) |
|
|
text = page.get() |
|
|
text = page.get() |
|
|
return mwparserfromhell.parse(text) |
|
|
return mwparserfromhell.parse(text) |
|
@@ -31,5 +31,5 @@ following code (via the API_):: |
|
|
return mwparserfromhell.parse(text) |
|
|
return mwparserfromhell.parse(text) |
|
|
|
|
|
|
|
|
.. _EarwigBot: https://github.com/earwig/earwigbot |
|
|
.. _EarwigBot: https://github.com/earwig/earwigbot |
|
|
.. _PyWikipedia: http://pywikipediabot.sourceforge.net/ |
|
|
|
|
|
|
|
|
.. _Pywikipedia: https://www.mediawiki.org/wiki/Manual:Pywikipediabot |
|
|
.. _API: http://mediawiki.org/wiki/API |
|
|
.. _API: http://mediawiki.org/wiki/API |