Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Armory Dashboard
Manage
Activity
Members
Labels
Plan
Issues
1
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Anton Sarukhanov
Armory Dashboard
Commits
65aabd8d
Commit
65aabd8d
authored
8 years ago
by
Anton Sarukhanov
Browse files
Options
Downloads
Patches
Plain Diff
Visual improvements
parent
d952aca3
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
scrape.py
+5
-2
5 additions, 2 deletions
scrape.py
templates/index.html
+18
-3
18 additions, 3 deletions
templates/index.html
with
23 additions
and
5 deletions
scrape.py
+
5
−
2
View file @
65aabd8d
...
@@ -24,7 +24,9 @@ def scrape():
...
@@ -24,7 +24,9 @@ def scrape():
event
=
requests
.
get
(
event_url
)
event
=
requests
.
get
(
event_url
)
event_tree
=
html
.
fromstring
(
event
.
content
)
event_tree
=
html
.
fromstring
(
event
.
content
)
event_details
=
event_tree
.
xpath
(
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
"
]
'
):
if
event_tree
.
xpath
(
'
//a[text()=
"
Final Results
"
]
'
):
fencers
=
event_tree
.
xpath
(
'
//div[@id=
"
finalResults
"
]/table/tr/td[2]/text()
'
)
fencers
=
event_tree
.
xpath
(
'
//div[@id=
"
finalResults
"
]/table/tr/td[2]/text()
'
)
event_status
=
"
Event Closed ({0} fencers)
"
.
format
(
len
(
fencers
))
event_status
=
"
Event Closed ({0} fencers)
"
.
format
(
len
(
fencers
))
...
@@ -40,7 +42,8 @@ def scrape():
...
@@ -40,7 +42,8 @@ def scrape():
except
:
except
:
pass
pass
this_event
=
{
this_event
=
{
'
name
'
:
event_details
,
'
name
'
:
event_name
,
'
time
'
:
event_time
,
'
status
'
:
event_status
,
'
status
'
:
event_status
,
'
fencers
'
:
[],
'
fencers
'
:
[],
'
previously_fenced
'
:
{},
'
previously_fenced
'
:
{},
...
...
This diff is collapsed.
Click to expand it.
templates/index.html
+
18
−
3
View file @
65aabd8d
...
@@ -3,16 +3,30 @@
...
@@ -3,16 +3,30 @@
<head>
<head>
<meta
charset=
"utf-8"
>
<meta
charset=
"utf-8"
>
<title>
Armory Dashboard
</title>
<title>
Armory Dashboard
</title>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
>
<style>
<style>
body
{
body
{
font
:
14px
sans-serif
;
font
:
14px
sans-serif
;
}
}
section
{
section
{
border-bottom
:
2
px
soli
d
#aaa
;
border-bottom
:
1
px
dashe
d
#aaa
;
}
}
p
{
h1
,
h2
,
h3
,
h4
,
h5
,
h6
{
margin
:
.35em
0
;
}
p
,
ul
{
margin
:
.25em
0
;
margin
:
.25em
0
;
}
}
a
:link
,
a
:active
,
a
:visited
{
text-decoration
:
none
;
color
:
#000
;
}
a
:hover
{
text-decoration
:
underline
;
color
:
#000
;
}
</style>
</style>
</head>
</head>
<body>
<body>
...
@@ -24,9 +38,10 @@
...
@@ -24,9 +38,10 @@
<section>
<section>
<a
name=
"{{e['name']}}"
>
<a
name=
"{{e['name']}}"
>
<h3><a
href=
"#{{e['name']}}"
>
{{e['name']}}
</a></h3>
<h3><a
href=
"#{{e['name']}}"
>
{{e['name']}}
</a></h3>
<h4>
{{e['time']}}
</h4>
<p>
{{e['status']}}
</p>
<p>
{{e['status']}}
</p>
{% if e['previously_fenced'] %}
{% if e['previously_fenced'] %}
<p>
{{e['previous_total']}} fencers have p
reviously checked in
:
</p>
<p>
{{e['previous_total']}} fencers have p
articipated in prior events
:
</p>
<ul>
<ul>
{% for pe in e['previously_fenced'] %}
{% for pe in e['previously_fenced'] %}
<li>
{{pe}} - {{e['previously_fenced'][pe]}} fencers
</li>
<li>
{{pe}} - {{e['previously_fenced'][pe]}} fencers
</li>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment