Created
December 8, 2015 13:16
-
-
Save rhossi/c795b02239be2aad26ba to your computer and use it in GitHub Desktop.
This file contains hidden or 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
from __future__ import print_function | |
from datetime import datetime | |
from urllib2 import urlopen | |
SITES = ['http://produto.mercadolivre.com.br/MLB-726627332-mini-pc-intel-nuc-i5-16gb-ssd-250-samsung-evo-5i5ryh-_JM', 'http://produto.mercadolivre.com.br/MLB-726629981-surface-4-pro-i5-8gb-ram-256-hd-teclado-e-mouse-_JM', 'http://produto.mercadolivre.com.br/MLB-716571875-iphone-6-plus-com-128gb-na-cor-space-gray-_JM'] # URL of the site to check | |
def lambda_handler(event, context): | |
try: | |
for num in range(1,10): | |
for s in SITES: | |
print('Checking {}...'.format(s)) | |
urlopen(s).read() | |
except: | |
print('Check failed!') | |
raise | |
else: | |
print('Check passed!') | |
finally: | |
print('Check complete at {}'.format(str(datetime.now()))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment