Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
eventdisplay
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Insights
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
gsu
eventdisplay
Commits
6630c2eb
Commit
6630c2eb
authored
7 years ago
by
Dirk Sarpe
Browse files
Options
Downloads
Patches
Plain Diff
updated website generation
parent
0357a2c7
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
background.jpg
+0
-0
0 additions, 0 deletions
background.jpg
event_display.py
+79
-0
79 additions, 0 deletions
event_display.py
eventdisplays_html_page.py
+0
-66
0 additions, 66 deletions
eventdisplays_html_page.py
with
79 additions
and
66 deletions
background.jpg
0 → 100644
+
0
−
0
View file @
6630c2eb
479 KiB
This diff is collapsed.
Click to expand it.
event_display.py
0 → 100644
+
79
−
0
View file @
6630c2eb
#!/usr/bin/python
# parse ical calendar and place parsed events in html code
import
requests
import
arrow
from
ics
import
Calendar
url
=
'
https://portal.idiv.de/ssf/ical/basic.ics?bi=393&ui=1026&pd=171497477d81eb659bd832ffe26c8bfe39d65fc3&v=1
'
tz
=
'
Europe/Berlin
'
now
=
arrow
.
now
(
tz
)
period
=
(
now
.
floor
(
'
day
'
),
now
.
replace
(
weeks
=+
2
))
c
=
Calendar
(
requests
.
get
(
url
).
text
)
my_list
=
[]
for
e
in
c
.
events
:
if
e
.
begin
>
period
[
0
]
and
e
.
begin
<
period
[
1
]:
my_list
.
append
((
e
.
name
,
e
.
begin
.
format
(
'
DD-MM-YYYY HH:mm:ss
'
),
e
.
location
))
event
=
[
my_list
[
0
][
0
],
my_list
[
1
][
0
],
my_list
[
2
][
0
]]
begin
=
[
my_list
[
0
][
1
],
my_list
[
1
][
1
],
my_list
[
2
][
1
]]
location
=
[
my_list
[
0
][
2
],
my_list
[
1
][
2
],
my_list
[
2
][
2
]]
html_page
=
"""
<html xmlns=
"
http://www.w3.org/1999/xhtml
"
>
<head>
<meta content=
"
de
"
http-equiv=
"
Content-Language
"
/>
<meta http-equiv=
"
refresh
"
content=
"
1800
"
/>
<meta content=
"
text/html; charset=utf-8
"
http-equiv=
"
Content-Type
"
/>
<title>BeginnEventLocationBeginnEventLo</title>
<style type=
"
text/css
"
>
.auto-style1 {
margin-top: 0px;
margin: 0px;
padding: 0px;
font-size: xx-large;
font-family: Arial, Helvetica, sans-serif;
color: #000000;
}
.auto-style3 {
font-family: Arial, Helvetica, sans-serif;
color: #000000;
font-size: xx-large;
}
</style>
</head>
<body bgcolor=
"
#FFFFCC
"
alink=
"
#FFFFCC
"
background=
"
background.jpg
"
>
<div id=
"
layer1
"
style=
"
background: #FADA08; position: absolute; left: 90px; top: 160px; width: 375px; height: 240px; z-index: 1
"
class=
"
auto-style3
"
>
<var> %s</var></div>
<div id=
"
layer2
"
style=
"
background: #FADA08; position: absolute; left: 495px; top: 160px; width: 950px; height: 50px; z-index: 2; background-color: #FADA08;
"
class=
"
auto-style3
"
>
<var> %s</var></div>
<div id=
"
layer3
"
style=
"
background: #FADA08; position: absolute; left: 495px; top: 240px; width: 950px; height: 160px; z-index: 3
"
class=
"
auto-style1
"
>
<var> %s</var></div>
<div id=
"
layer4
"
style=
"
background: #79B248; position: absolute; left: 90px; top: 430px; width: 375px; height: 240px; z-index: 4
"
class=
"
auto-style3
"
>
<var> %s</var></div>
<div id=
"
layer5
"
style=
"
background: #79B248; position: absolute; left: 495px; top: 430px; width: 950px; height: 50px; z-index: 5
"
class=
"
auto-style3
"
>
<var> %s</var></div>
<div id=
"
layer6
"
style=
"
background: #79B248; position: absolute; left: 495px; top: 510px; width: 950px; height: 160px; z-index: 6
"
class=
"
auto-style3
"
>
<var> %s</var></div>
<div id=
"
layer7
"
style=
"
background: #4D90C7; position: absolute; left: 90px; top: 700px; width: 375px; height: 240px; z-index: 7
"
class=
"
auto-style3
"
>
<var> %s</var></div>
<div id=
"
layer8
"
style=
"
background: #4D90C7; position: absolute; left: 495px; top: 700px; width: 950px; height: 50px; z-index: 8
"
class=
"
auto-style3
"
>
<var> %s</var></div>
<div id=
"
layer9
"
style=
"
background: #4D90C7; position: absolute; left: 495px; top: 780px; width: 950px; height: 160px; z-index: 9
"
class=
"
auto-style3
"
>
<var> %s</var></div>
<div id=
"
layer10
"
style=
"
position: absolute; left: 1450px; top: 200px; width: 203px; height: 93px; z-index: 10
"
>
<div style=
"
text-align:center;width:400px;padding:0em;
"
> <h2><a id=
"
717864741
"
href=
"
http://www.uhr-homepage.de
"
>Uhr Homepage Billig</a><script src=
"
https://www.uhr-homepage.de/data.php?i=717864741&h=172&w=292
"
type=
"
text/javascript
"
></script></div>
</div>
<div id=
"
layer11
"
style=
"
position: absolute; left: 1500px; top: 570px; width: 241px; height: 242px; z-index: 11; background-color: #FFFFCC;
"
>
<script type=
"
text/javascript
"
>document.write(
"
<iframe id =
\\
"
widget
\\
"
width=
\\
"
300
\\
"
height=
\\
"
270
\\
"
src=
\\
"
http://www.wetter-deutschland.com/international/europa/deutschland/leipzig/widget/w300/color-hellgruen?utm_source=widget&utm_medium=
"
+top.location.hostname+
"
&utm_content=
"
+top.location.href+
"
&utm_campaign=Wetter%%2BWidget
\\
"
frameborder=
\\
"
0
\\
"
scrolling=
\\
"
no
\\
"
></iframe>
"
);</script><center style=
"
padding-top:5px; padding-bottom:5px; font-size:14px; line-height:18px; font-family:arial;
"
><br/></center><br />
</div>
</body>
</html>
"""
%
(
event
[
0
],
location
[
0
],
begin
[
0
],
event
[
1
],
location
[
1
],
begin
[
1
],
event
[
2
],
location
[
2
],
begin
[
2
])
out_file
=
open
(
"
/home/eventviewer/events/events.html
"
,
"
w
"
)
out_file
.
write
(
html_page
.
encode
(
"
utf8
"
))
out_file
.
close
()
This diff is collapsed.
Click to expand it.
eventdisplays_html_page.py
deleted
100644 → 0
+
0
−
66
View file @
0357a2c7
#!/usr/bin/python
import
requests
import
arrow
from
ics
import
Calendar
url
=
'
https://portal.idiv.de/ssf/ical/basic.ics?bi=393&ui=1026&pd=171497477d81eb659bd832ffe26c8bfe39d65fc3&v=1
'
tz
=
'
Europe/Berlin
'
now
=
arrow
.
now
(
tz
)
period
=
(
now
.
floor
(
'
day
'
),
now
.
replace
(
weeks
=+
8
))
c
=
Calendar
(
requests
.
get
(
url
).
text
)
my_list
=
[]
for
e
in
c
.
events
:
if
e
.
begin
>
period
[
0
]
and
e
.
begin
<
period
[
1
]:
my_list
.
append
((
e
.
name
,
e
.
begin
.
format
(
'
DD-MM-YYYY HH:mm:ss
'
),
e
.
location
))
event
=
[
my_list
[
0
][
0
],
my_list
[
1
][
0
],
my_list
[
2
][
0
]]
begin
=
[
my_list
[
0
][
1
],
my_list
[
1
][
1
],
my_list
[
2
][
1
]]
location
=
[
my_list
[
0
][
2
],
my_list
[
1
][
2
],
my_list
[
2
][
2
]]
html_page
=
"""
<!DOCTYPE html>
<html>
<head>
<title>Events</title>
<meta charset=
"
utf-8
"
>
<link href=
'
http://fonts.googleapis.com/css?family=Ubuntu|Ruda
'
rel=
'
stylesheet
'
type=
'
text/css
'
>
<link rel=
"
stylesheet
"
type=
"
text/css
"
href=
"
style.css
"
>
<script type=
"
text/javascript
"
src=
"
calendar.js
"
></script>
</head>
<style>
table {{
width:100%;
}}
table, th, td {{
border: 1px solid black;
border-collapse: collapse;
}}
th, td {{
padding: 5px;
text-align: left;
}}
table#t01 tr:nth-child(even) {{
background-color: #eee;
}}
table#t01 tr:nth-child(odd) {{
background-color:#fff;
}}
table#t01 th {{
background-color: black;
color: white;
}}
</style>
</head>
<body>
table id=
"
t01
"
>
<tr>
<th>{the_event}</th>
<th>{the_date}</th>
<th>{the_location}</th>
</tr>
</body>
</html>
"""
.
format
(
the_event
=
event
[
0
],
the_location
=
location
[
0
],
the_date
=
begin
[
0
])
out_file
=
open
(
'
test.html
'
,
'
w
'
)
out_file
.
write
(
html_page
)
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