Created
August 8, 2013 20:12
-
-
Save bbengfort/6188250 to your computer and use it in GitHub Desktop.
For grant
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 os | |
import sys | |
import time | |
ACCESS_KEY = '' | |
SECRET_KEY = '' | |
def get_name_for_file(url): | |
name = raw_input("What should we name %s? " % url) | |
return name | |
def send_to_s3(): | |
pass | |
def handle_url(url): | |
print url | |
name = get_name_for_file(url) | |
#pretend we're downloading | |
time.sleep(2) | |
print name | |
# do s3 thing | |
send_to_s3() | |
def handle_line(line): | |
# This is the clean up URLS and fix & sign thingy. | |
line = line.strip() | |
if line and line.startswith('http'): | |
handle_url(line) | |
def readlines(path): | |
with open(path, 'r') as urls: | |
for idx, line in enumerate(urls): | |
handle_line(line) | |
if __name__ == "__main__": | |
# readlines("urls.txt") | |
path = os.path.abspath("urls.txt") | |
print path |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment