Skip to content

Instantly share code, notes, and snippets.

@ka010
Created January 31, 2010 16:44
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 ka010/291141 to your computer and use it in GitHub Desktop.
Save ka010/291141 to your computer and use it in GitHub Desktop.
import urllib
import os
dirlist = ['dsintro', 'socketbasedds', 'remotecalls','distributedobjects', 'distributedservices1', 'distributedservices2', 'security1', 'components', 'systemmanagement', 'designissues', 'webservices', 'peertopeer', 'soa', ]
for dir in dirlist:
i=1
for i in range(1,100):
try:
print '** Processing : ' + dir + ' Slide#: ' + str(i)
page = urllib.urlopen('http://www.kriha.de/krihaorg/docs/lectures/distributedsystems/'+ dir + '/pictures/Folie'+str(i)+'.PNG').read()
if '404 Not Found' in page:
print '** No more slides here, moving on...'
break
else:
f = open(str(dirlist.index(dir)) + '-' + dir + '_slide'+str(i)+'.png','w')
f.write(page)
except:
print '** Error, something went wrong..'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment