Created
September 19, 2012 21:23
-
-
Save shackenberg/3752367 to your computer and use it in GitHub Desktop.
soup.io image downloader / backup script
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
import feedparser | |
import urllib | |
d = feedparser.parse(XXX) # link to the soup.io rss feed | |
PATH = 'old_soup/' | |
print len(d.entries) | |
for entry in d.entries: | |
print entry['links'][0]['href'] | |
if entry['links'][0]['type'] == u'image/jpeg': | |
link = entry['links'][0]['href'] | |
filename = link.split('/')[-1] | |
urllib.urlretrieve(link, PATH + filename) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment