Beispiel #1
0
 def get_data_of_the_day(self, now, urls):
     max_time = time.mktime(now.timetuple())
     min_time = time.mktime(datetime(now.year, now.month, now.day).timetuple())
     infos = CollectedData.get_info_list(max_time, min_time, urls)
     return infos
Beispiel #2
0
 def get(self):
     max_time = time.time()
     min_time = max_time - 24*3600
     info_list = CollectedData.get_info_list(max_time, min_time)
     template = jinja_env.get_template("server/list.html")
     self.write(template.render(info_list=info_list))
Beispiel #3
0
 def get(self, id):
     data = CollectedData.get_detail(id)
     if not data:
         raise tornado.web.HTTPError(404)
     self.write(DataCollecter.render_from_json(data))
Beispiel #4
0
 def post(self):
     body = self.request.body
     CollectedData.save(body)
     return
Beispiel #5
0
 def get_data_of_the_day(self, now, urls):
     max_time = time.mktime(now.timetuple())
     min_time = time.mktime(
         datetime(now.year, now.month, now.day).timetuple())
     infos = CollectedData.get_info_list(max_time, min_time, urls)
     return infos
Beispiel #6
0
 def get(self, id):
     data = CollectedData.get_detail(id)
     if not data:
         raise tornado.web.HTTPError(404)
     self.write(DataCollecter.render_from_json(data))
Beispiel #7
0
 def get(self):
     max_time = time.time()
     min_time = max_time - 24 * 3600
     info_list = CollectedData.get_info_list(max_time, min_time)
     template = jinja_env.get_template("server/list.html")
     self.write(template.render(info_list=info_list))
Beispiel #8
0
 def post(self):
     body = self.request.body
     CollectedData.save(body)
     return