Skip to content

Commit

Permalink
updated flickrapi.shorturl and its tests to use https url
Browse files Browse the repository at this point in the history
also updated docstring link to discussion about shorturl to https
  • Loading branch information
okzach authored and sybrenstuvel committed Jun 22, 2018
1 parent f0a6eae commit a4a9670
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion doc/8-shorturl.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Short Flickr URLs
======================================================================

Flickr supports linking to a photo page using a short url such as
http://flic.kr/p/6BTTT6. The ``flickrapi.shorturl`` module contains
https://flic.kr/p/6BTTT6. The ``flickrapi.shorturl`` module contains
functionality for working with those short URLs.

``flickrapi.shorturl.encode(photo ID)``:
Expand Down
10 changes: 5 additions & 5 deletions flickrapi/shorturl.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# -*- coding: utf-8 -*-

"""Helper functions for the short http://fli.kr/p/... URL notation.
"""Helper functions for the short https://fli.kr/p/... URL notation.
Photo IDs can be converted to and from Base58 short IDs, and a short
URL can be generated from a photo ID.
The implementation of the encoding and decoding functions is based on
the posts by stevefaeembra and Kohichi on
http://www.flickr.com/groups/api/discuss/72157616713786392/
https://www.flickr.com/groups/api/discuss/72157616713786392/
"""

Expand All @@ -17,7 +17,7 @@

ALPHABET = u'123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ'
ALPHALEN = len(ALPHABET)
SHORT_URL = u'http://flic.kr/p/%s'
SHORT_URL = u'https://flic.kr/p/%s'


def encode(photo_id):
Expand Down Expand Up @@ -67,9 +67,9 @@ def url(photo_id):
"""url(photo id) -> short url
>>> url(u'4325695128')
'http://flic.kr/p/7Afjsu'
'https://flic.kr/p/7Afjsu'
>>> url(u'2811466321')
'http://flic.kr/p/5hruZg'
'https://flic.kr/p/5hruZg'
"""

short_id = encode(photo_id)
Expand Down
4 changes: 2 additions & 2 deletions tests/test_shorturl.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ def test_short_url(self):
'''Test photo ID to short URL conversion.'''

self.assertEqual(shorturl.url(u'4325695128'),
u'http://flic.kr/p/7Afjsu')
u'https://flic.kr/p/7Afjsu')
self.assertEqual(shorturl.url(u'2811466321'),
u'http://flic.kr/p/5hruZg')
u'https://flic.kr/p/5hruZg')

0 comments on commit a4a9670

Please sign in to comment.