Untitled

 avatar
unknown
python
a year ago
887 B
27
No Index
import time 
import hashlib 
import winsound
from urllib.request import urlopen, Request

url = Request('https://shop.avicii.com/collections/all-products?sort_by=created-descending')
response = urlopen(url).read() 
  
currentHash = hashlib.sha224(response).hexdigest() 
print("running") 
time.sleep(10)
while True: 
    try: 
        response = urlopen(url).read() 
        time.sleep(30) 
        response = urlopen(url).read() 
        newHash = hashlib.sha224(response).hexdigest() 
  
        if newHash == currentHash:
            print("nothing changed")
            continue
  
        else:
            winsound.Beep(440, 250)
            print("something changed") 
            response = urlopen(url).read() 
            currentHash = hashlib.sha224(response).hexdigest()   
            time.sleep(30) 
            continue
  
    except Exception as e: 
        print("error")
Editor is loading...
Leave a Comment