From 3a577560684bdea57796a01771534720d98b734d Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Sun, 14 Jun 2015 17:21:48 -0400 Subject: [PATCH] Fix HTTPS requirement for enwiki API. --- README.rst | 2 +- docs/integration.rst | 2 +- tests/test_docs.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.rst b/README.rst index 7e3e68d..c361a56 100644 --- a/README.rst +++ b/README.rst @@ -139,7 +139,7 @@ If you're not using a library, you can parse any page using the following code from urllib.parse import urlencode from urllib.request import urlopen import mwparserfromhell - API_URL = "http://en.wikipedia.org/w/api.php" + API_URL = "https://en.wikipedia.org/w/api.php" def parse(title): data = {"action": "query", "prop": "revisions", "rvlimit": 1, diff --git a/docs/integration.rst b/docs/integration.rst index bbd00bb..af3abc9 100644 --- a/docs/integration.rst +++ b/docs/integration.rst @@ -25,7 +25,7 @@ If you're not using a library, you can parse any page using the following code from urllib.parse import urlencode from urllib.request import urlopen import mwparserfromhell - API_URL = "http://en.wikipedia.org/w/api.php" + API_URL = "https://en.wikipedia.org/w/api.php" def parse(title): data = {"action": "query", "prop": "revisions", "rvlimit": 1, diff --git a/tests/test_docs.py b/tests/test_docs.py index d50e90e..1c94130 100644 --- a/tests/test_docs.py +++ b/tests/test_docs.py @@ -115,8 +115,8 @@ class TestDocs(unittest.TestCase): @unittest.skipIf("NOWEB" in os.environ, "web test disabled by environ var") def test_readme_5(self): """test a block of example code in the README; includes a web call""" - url1 = "http://en.wikipedia.org/w/api.php" - url2 = "http://en.wikipedia.org/w/index.php?title={0}&action=raw" + url1 = "https://en.wikipedia.org/w/api.php" + url2 = "https://en.wikipedia.org/w/index.php?title={0}&action=raw" title = "Test" data = {"action": "query", "prop": "revisions", "rvlimit": 1, "rvprop": "content", "format": "json", "titles": title}