summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPacien TRAN-GIRARD2014-10-22 08:27:15 +0200
committerPacien TRAN-GIRARD2014-10-22 08:27:15 +0200
commitb3651e48e4cb1d90863da1d22997eff59eff74c1 (patch)
tree3e9326e4e263038706bc81cf9d44e0a7df3183c3 /src
parentb2b0a0603957b9581efd23debbc42d9281c63300 (diff)
downloadwikistats-b3651e48e4cb1d90863da1d22997eff59eff74c1.tar.gz
Use proper way to construct url
Diffstat (limited to 'src')
-rw-r--r--src/downloader/__init__.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/downloader/__init__.py b/src/downloader/__init__.py
index 4dd6169..830bdec 100644
--- a/src/downloader/__init__.py
+++ b/src/downloader/__init__.py
@@ -6,6 +6,7 @@ program, including manipulation of the wikimedia API.
6""" 6"""
7 7
8import urllib.request 8import urllib.request
9import urllib.parse
9 10
10 11
11class Downloader(): 12class Downloader():
@@ -86,5 +87,11 @@ class WikimediaAPI():
86 "Module talk": "829", 87 "Module talk": "829",
87 "Topic": "2600" 88 "Topic": "2600"
88 } 89 }
89 return self.endpoint + "?action=query&list=recentchanges&format="\ 90
90 + self.return_format + "&namespace=" + rcnamespaces[namespace] 91 url_params = {
92 "action": "query",
93 "list": "recentchanges",
94 "format": self.return_format,
95 "namespace": rcnamespaces[namespace],
96 }
97 return urllib.parse.urljoin(self.endpoint, urllib.parse.urlencode(url_params).encode("utf8"))