Xqt has submitted this change and it was merged.
Change subject: Implement wblinktitles action ......................................................................
Implement wblinktitles action
Change-Id: Ida539babbdcbaa664ddfbbea808004e679a7cb63 --- M pywikibot/site.py 1 file changed, 24 insertions(+), 0 deletions(-)
Approvals: FelixReimann: Looks good to me, but someone else must approve Xqt: Looks good to me, approved
diff --git a/pywikibot/site.py b/pywikibot/site.py index 13477b0..742dd76 100644 --- a/pywikibot/site.py +++ b/pywikibot/site.py @@ -3681,6 +3681,30 @@ data = req.submit() return data
+ def linkTitles(self, page1, page2, bot=True): + """ + Link two pages together + @param page1: First page to link + @type page1: pywikibot.Page + @param page2: Second page to link + @type page2: pywikibot.Page + @param bot: whether to mark edit as bot + @return: dict API output + """ + params = { + 'action': 'wblinktitles', + 'tosite': page1.site.dbName(), + 'totitle': page1.title(), + 'fromsite': page2.site.dbName(), + 'fromtitle': page2.title(), + 'token': self.token(page1, 'edit') + } + if bot: + params['bot'] = 1 + req = api.Request(site=self, **params) + data = req.submit() + return data + # deprecated BaseSite methods def fam(self): raise NotImplementedError
pywikibot-commits@lists.wikimedia.org