From 65aabd8d2fef33a2a39ab75a865d39affcf4c787 Mon Sep 17 00:00:00 2001 From: Anton Sarukhanov <code@ant.sr> Date: Sun, 27 Nov 2016 10:10:44 -0500 Subject: [PATCH] Visual improvements --- scrape.py | 7 +++++-- templates/index.html | 21 ++++++++++++++++++--- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/scrape.py b/scrape.py index f9c4f59..aee9774 100644 --- a/scrape.py +++ b/scrape.py @@ -24,7 +24,9 @@ def scrape(): event = requests.get(event_url) event_tree = html.fromstring(event.content) event_details = event_tree.xpath( - '//span[@class="tournDetails"]/text()')[0] + '//span[@class="tournDetails"]/text()') + event_name = event_details[0] + event_time = event_details[1] if event_tree.xpath('//a[text()="Final Results"]'): fencers = event_tree.xpath('//div[@id="finalResults"]/table/tr/td[2]/text()') event_status = "Event Closed ({0} fencers)".format(len(fencers)) @@ -40,7 +42,8 @@ def scrape(): except: pass this_event = { - 'name': event_details, + 'name': event_name, + 'time': event_time, 'status': event_status, 'fencers': [], 'previously_fenced': {}, diff --git a/templates/index.html b/templates/index.html index e5574e5..e34ef73 100644 --- a/templates/index.html +++ b/templates/index.html @@ -3,16 +3,30 @@ <head> <meta charset="utf-8"> <title>Armory Dashboard</title> + <meta name="viewport" content="width=device-width, initial-scale=1"> <style> body { font: 14px sans-serif; } section { - border-bottom: 2px solid #aaa; + border-bottom: 1px dashed #aaa; } - p { + h1, h2, h3, h4, h5, h6 { + margin: .35em 0; + } + p, ul { margin: .25em 0; } + a:link, + a:active, + a:visited { + text-decoration: none; + color: #000; + } + a:hover { + text-decoration: underline; + color: #000; + } </style> </head> <body> @@ -24,9 +38,10 @@ <section> <a name="{{e['name']}}"> <h3><a href="#{{e['name']}}">{{e['name']}}</a></h3> + <h4>{{e['time']}}</h4> <p>{{e['status']}}</p> {% if e['previously_fenced'] %} - <p>{{e['previous_total']}} fencers have previously checked in:</p> + <p>{{e['previous_total']}} fencers have participated in prior events:</p> <ul> {% for pe in e['previously_fenced'] %} <li>{{pe}} - {{e['previously_fenced'][pe]}} fencers</li> -- GitLab