ccmny

costa concordia

Jan 14th, 2012
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.39 KB | None | 0 0
  1. import urllib.request as urllib
  2. import time
  3. from time import  gmtime, strftime
  4.  
  5. image = urllib.URLopener()
  6.  
  7. while True:
  8.     timestr = strftime("%H-%M-%S", gmtime())
  9.     filename = "cc_" + timestr + ".jpg"
  10.     try:
  11.         image.retrieve("http://www.giglionews.com/isoladelgiglio_porto.jpg", "images/" + filename)
  12.         print("Saved new image at " + filename)
  13.     except:
  14.         print("Error at " + timestr)
  15.     time.sleep(10)
Advertisement
Add Comment
Please, Sign In to add comment