Last active
August 29, 2015 14:15
-
-
Save nevalsar/f78913463dc59746c794 to your computer and use it in GitHub Desktop.
Downloader script for companion slides from http://db-book.com/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# script to download all study material slides from http://db-book.com/ | |
# ======================================================================= | |
# Author : Nevin Valsaraj <nevin[dot]valsaraj32[at]gmail[dot]com> | |
# Distributed under the MIT License. | |
# (See full license at http://opensource.org/licenses/MIT) | |
# ======================================================================= | |
# In short, I can't be held accountable if you wreck your computer. | |
import urllib | |
import os | |
directory = "DB_Book_Slides" | |
if not os.path.exists(directory): | |
os.makedirs(directory) | |
filenames = [] | |
for i in range(1, 27): | |
filenames.append('ch' + str(i)) | |
filenames.extend(['appB', 'appC', 'appD', 'appE']) | |
for i in filenames: | |
urllib.urlretrieve( | |
"http://codex.cs.yale.edu/avi/db-book/db6/slide-dir/PDF-dir/" + | |
str(i) + ".pdf", | |
os.path.join(directory, "chapter_" + str(i) + ".pdf") | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment