diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/downloader/__init__.py | 11 |
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 | ||
8 | import urllib.request | 8 | import urllib.request |
9 | import urllib.parse | ||
9 | 10 | ||
10 | 11 | ||
11 | class Downloader(): | 12 | class 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")) | ||