Explorar el Código

Fix HTTPS requirement for enwiki API.

tags/v0.4.1
Ben Kurtovic hace 9 años
padre
commit
3a57756068
Se han modificado 3 ficheros con 4 adiciones y 4 borrados
  1. +1
    -1
      README.rst
  2. +1
    -1
      docs/integration.rst
  3. +2
    -2
      tests/test_docs.py

+ 1
- 1
README.rst Ver fichero

@@ -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.parse import urlencode
from urllib.request import urlopen from urllib.request import urlopen
import mwparserfromhell import mwparserfromhell
API_URL = "http://en.wikipedia.org/w/api.php"
API_URL = "https://en.wikipedia.org/w/api.php"


def parse(title): def parse(title):
data = {"action": "query", "prop": "revisions", "rvlimit": 1, data = {"action": "query", "prop": "revisions", "rvlimit": 1,


+ 1
- 1
docs/integration.rst Ver fichero

@@ -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.parse import urlencode
from urllib.request import urlopen from urllib.request import urlopen
import mwparserfromhell import mwparserfromhell
API_URL = "http://en.wikipedia.org/w/api.php"
API_URL = "https://en.wikipedia.org/w/api.php"


def parse(title): def parse(title):
data = {"action": "query", "prop": "revisions", "rvlimit": 1, data = {"action": "query", "prop": "revisions", "rvlimit": 1,


+ 2
- 2
tests/test_docs.py Ver fichero

@@ -115,8 +115,8 @@ class TestDocs(unittest.TestCase):
@unittest.skipIf("NOWEB" in os.environ, "web test disabled by environ var") @unittest.skipIf("NOWEB" in os.environ, "web test disabled by environ var")
def test_readme_5(self): def test_readme_5(self):
"""test a block of example code in the README; includes a web call""" """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" title = "Test"
data = {"action": "query", "prop": "revisions", "rvlimit": 1, data = {"action": "query", "prop": "revisions", "rvlimit": 1,
"rvprop": "content", "format": "json", "titles": title} "rvprop": "content", "format": "json", "titles": title}


Cargando…
Cancelar
Guardar