Update links to HTTPS and current 301 redirects in docs/templates/themes (#2661)

This also updates the Tumblr API to use HTTPS as documented in the
current Tumblr API docs.
This commit is contained in:
Kurt McKee 2020-04-12 09:38:35 -05:00 committed by GitHub
commit 7bbd3dc6fb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
128 changed files with 267 additions and 266 deletions

View file

@ -437,7 +437,7 @@ def tumblr2fields(api_key, blogname):
import urllib.request as urllib_request
def get_tumblr_posts(api_key, blogname, offset=0):
url = ("http://api.tumblr.com/v2/blog/%s.tumblr.com/"
url = ("https://api.tumblr.com/v2/blog/%s.tumblr.com/"
"posts?api_key=%s&offset=%d&filter=raw") % (
blogname, api_key, offset)
request = urllib_request.Request(url)
@ -607,7 +607,7 @@ def get_out_filename(output_path, filename, ext, kind,
filename = os.path.basename(filename)
# Enforce filename restrictions for various filesystems at once; see
# http://en.wikipedia.org/wiki/Filename#Reserved_characters_and_words
# https://en.wikipedia.org/wiki/Filename#Reserved_characters_and_words
# we do not need to filter words because an extension will be appended
filename = re.sub(r'[<>:"/\\|?*^% ]', '-', filename) # invalid chars
filename = filename.lstrip('.') # should not start with a dot