Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
This Python function downloads a given range of Phaser World back issues.
def download(issues):
"""This function downloads a given range of Phaser World back
issues into the current working directory. Any arguments will
be passed to the `range` function to define the list of issue
numbers that will be downloaded."""
import os
url_template = "https://phaser.io/images/newsletter/pdf/issue{}.pdf"
pdf_template = '"./PhaserWorld{}.pdf"'
cmd_template = "curl -o {} {}"
for n in range(*issues):
url = url_template.format(n)
pdf = pdf_template.format(n)
cmd = cmd_template.format(path, url)
os.system(cmd)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.