Skip to content

Instantly share code, notes, and snippets.

@wozozo
Created August 6, 2009 17:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wozozo/163456 to your computer and use it in GitHub Desktop.
Save wozozo/163456 to your computer and use it in GitHub Desktop.
#!/opt/local/bin/python
# -*- coding: utf-8 -*-
import os
import urllib
import re
SAVE_DIR = '/tmp/foobar'
p = re.compile('http://gyazo.com.*.png')
i = 0
for line in open('/tmp/log.txt'):
m = p.search(line)
if m != None:
url = line[m.start():m.end()]
print(url)
urllib.urlretrieve(url, SAVE_DIR + os.path.split(url)[1])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment