Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use HTTPs for everything #160

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Wikipedia data, not getting it.
>>> ny.title
# u'New York'
>>> ny.url
# u'http://en.wikipedia.org/wiki/New_York'
# u'https://en.wikipedia.org/wiki/New_York'
>>> ny.content
# u'New York is a state in the Northeastern region of the United States. New York is the 27th-most exten'...
>>> ny.links[0]
Expand All @@ -42,7 +42,7 @@ Wikipedia data, not getting it.
>>> wikipedia.summary("Facebook", sentences=1)
# Facebook est un service de réseautage social en ligne sur Internet permettant d'y publier des informations (photographies, liens, textes, etc.) en contrôlant leur visibilité par différentes catégories de personnes.

Note: this library was designed for ease of use and simplicity, not for advanced use. If you plan on doing serious scraping or automated requests, please use `Pywikipediabot <http://www.mediawiki.org/wiki/Manual:Pywikipediabot>`__ (or one of the other more advanced `Python MediaWiki API wrappers <http://en.wikipedia.org/wiki/Wikipedia:Creating_a_bot#Python>`__), which has a larger API, rate limiting, and other features so we can be considerate of the MediaWiki infrastructure.
Note: this library was designed for ease of use and simplicity, not for advanced use. If you plan on doing serious scraping or automated requests, please use `Pywikibot <https://www.mediawiki.org/wiki/Manual:Pywikibot>`__ (or one of the other more advanced `Python MediaWiki API wrappers <https://en.wikipedia.org/wiki/Wikipedia:Creating_a_bot#Python>`__), which has a larger API, rate limiting, and other features so we can be considerate of the MediaWiki infrastructure.

Installation
------------
Expand Down Expand Up @@ -95,7 +95,7 @@ Credits
@richardasaurus for inspiration
- @nmoroze and @themichaelyang for feedback and suggestions
- The `Wikimedia
Foundation <http://wikimediafoundation.org/wiki/Home>`__ for giving
Foundation <https://wikimediafoundation.org/wiki/Home>`__ for giving
the world free access to data


Expand Down
4 changes: 2 additions & 2 deletions docs/source/_themes/flask_small/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
{% block relbar1 %}{% endblock %}
{% block relbar2 %}
{% if theme_github_fork %}
<a href="http://github.com/{{ theme_github_fork }}"><img style="position: fixed; top: 0; right: 0; border: 0;"
src="http://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub" /></a>
<a href="https://github.com/{{ theme_github_fork }}"><img style="position: fixed; top: 0; right: 0; border: 0;"
src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub" /></a>
{% endif %}
{% endblock %}
{% block sidebar1 %}{% endblock %}
Expand Down
4 changes: 2 additions & 2 deletions docs/source/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,13 @@ But watch out - ``wikipedia.summary`` will raise a ``DisambiguationError`` if th
u'New York'

>>> ny.url
u'http://en.wikipedia.org/wiki/NewYork'
u'https://en.wikipedia.org/wiki/NewYork'

>>> ny.content
u'New York is a state in the Northeastern region of the United States. New York is the 27th-most exten'...

>>> ny.images[0]
u'http://upload.wikimedia.org/wikipedia/commons/9/91/New_York_quarter%2C_reverse_side%2C_2001.jpg'
u'https://upload.wikimedia.org/wikipedia/commons/9/91/New_York_quarter%2C_reverse_side%2C_2001.jpg'

>>> ny.links[0]
u'1790 United States Census'
Expand Down
2 changes: 1 addition & 1 deletion tests/lang_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ class TestLang(unittest.TestCase):

def test_lang(self):
wikipedia.set_lang("fr")
self.assertEqual(wikipedia.API_URL, 'http://fr.wikipedia.org/w/api.php')
self.assertEqual(wikipedia.API_URL, 'https://fr.wikipedia.org/w/api.php')
8 changes: 4 additions & 4 deletions tests/page_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def test_redirect_true(self):
mp = wikipedia.page("Menlo Park, New Jersey")

self.assertEqual(mp.title, "Edison, New Jersey")
self.assertEqual(mp.url, "http://en.wikipedia.org/wiki/Edison,_New_Jersey")
self.assertEqual(mp.url, "https://en.wikipedia.org/wiki/Edison,_New_Jersey")

def test_redirect_false(self):
"""Test that page raises an error on a redirect when redirect == False."""
Expand Down Expand Up @@ -74,7 +74,7 @@ def test_auto_suggest(self):
butterfly = wikipedia.page("butteryfly")

self.assertEqual(butterfly.title, "Butterfly")
self.assertEqual(butterfly.url, "http://en.wikipedia.org/wiki/Butterfly")
self.assertEqual(butterfly.url, "https://en.wikipedia.org/wiki/Butterfly")


class TestPage(unittest.TestCase):
Expand All @@ -97,8 +97,8 @@ def test_title(self):

def test_url(self):
"""Test the url."""
self.assertEqual(self.celtuce.url, "http://en.wikipedia.org/wiki/Celtuce")
self.assertEqual(self.cyclone.url, "http://en.wikipedia.org/wiki/Tropical_Depression_Ten_(2005)")
self.assertEqual(self.celtuce.url, "https://en.wikipedia.org/wiki/Celtuce")
self.assertEqual(self.cyclone.url, "https://en.wikipedia.org/wiki/Tropical_Depression_Ten_(2005)")

def test_content(self):
"""Test the plain text content."""
Expand Down
Loading