Legoktm has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/85180


Change subject: Implement wblinktitles action
......................................................................

Implement wblinktitles action

Change-Id: Ida539babbdcbaa664ddfbbea808004e679a7cb63
---
M pywikibot/site.py
1 file changed, 23 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/80/85180/1

diff --git a/pywikibot/site.py b/pywikibot/site.py
index 13477b0..52adbf4 100644
--- a/pywikibot/site.py
+++ b/pywikibot/site.py
@@ -3681,6 +3681,29 @@
         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 = {
+            '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: newchange
Gerrit-Change-Id: Ida539babbdcbaa664ddfbbea808004e679a7cb63
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Legoktm <[email protected]>

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

Reply via email to