From a933d441ceb207b246ddfa92f87f1d85f91a388c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Kn=C3=BCttel?= Date: Tue, 19 Feb 2019 14:15:28 +0100 Subject: [PATCH] added support for different languages --- exam/ex01/url.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exam/ex01/url.py b/exam/ex01/url.py index bc83561..6620184 100644 --- a/exam/ex01/url.py +++ b/exam/ex01/url.py @@ -1,3 +1,3 @@ -def construct_url(title): - return "https://en.wikipedia.org/w/api.php?action=query&prop=links&pllimit=500&titles={}&format=json".format(title) +def construct_url(title, lang="en"): + return "https://{}.wikipedia.org/w/api.php?action=query&prop=links&pllimit=500&titles={}&format=json".format(lang, title)