Created
March 10, 2014 03:57
-
-
Save ngarbezza/9459235 to your computer and use it in GitHub Desktop.
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 | |
import datetime, os | |
START_DATE = datetime.date(2008, 6, 28) | |
BASE_URL = "http://static.macanudo.com.ar/macanudo_pics/" | |
current_date = START_DATE | |
while current_date <= datetime.date.today(): | |
file_to_download = current_date.strftime("%Y%m%d") + ".jpg" | |
if os.path.exists(file_to_download): | |
print("Macanudo del " + str(current_date) + " ya esta descargado") | |
else: | |
print("Descargando Macanudo del " + str(current_date) + "...") | |
os.system("wget -t 1 -T 5 " + BASE_URL + file_to_download) | |
current_date = current_date + datetime.timedelta(days=1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment