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

-- 
To view, visit https://gerrit.wikimedia.org/r/85180
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ida539babbdcbaa664ddfbbea808004e679a7cb63
Gerrit-PatchSet: 2
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Legoktm <[email protected]>
Gerrit-Reviewer: FelixReimann <[email protected]>
Gerrit-Reviewer: Ladsgroup <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: Merlijn van Deen <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to