From 359c467586247bcde1dde7380c84a3365fa08bf6 Mon Sep 17 00:00:00 2001 From: Davide Alberani Date: Sat, 20 Jan 2018 18:19:41 +0100 Subject: [PATCH] make request --- diffido.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/diffido.py b/diffido.py index ab3180d..a8057b0 100755 --- a/diffido.py +++ b/diffido.py @@ -4,6 +4,7 @@ import os import json import logging +import requests from tornado.ioloop import IOLoop # from lxml.html.diff import htmldiff @@ -26,6 +27,7 @@ SCHEDULES_FILE = 'conf/schedules.json' logger = logging.getLogger() logger.setLevel(logging.INFO) + def read_schedules(): if not os.path.isfile(SCHEDULES_FILE): return {'schedules': {}} @@ -63,6 +65,8 @@ def run_job(id_=None, *args, **kwargs): if not url: return print('Running job id:%s title:%s url: %s' % (id_, schedule.get('title', ''), url)) + req = requests.get(url, timeout=(30.10, 240)) + print(req.text) def scheduler_update(scheduler, id_):