-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsesiones.py
More file actions
executable file
·42 lines (29 loc) · 1.21 KB
/
sesiones.py
File metadata and controls
executable file
·42 lines (29 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/usr/bin/python
import dominate
import requests
import warnings
from dominate import document
from dominate.tags import *
warnings.filterwarnings("ignore")
doc = dominate.document(title='Sesiones')
urls = [
'https://domain.tld/sessioncounter',
]
results = []
with doc.head:
body(onload='JavaScript:timedRefresh(2000);')
script(type='text/javascript', src='https://static.uchile.cl/demre/asistente/refresh.js')
link(rel='stylesheet', href='http://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css')
link(rel='stylesheet', href='http://maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css')
script(type='text/javascript', src='http://code.jquery.com/jquery-1.10.2.min.js')
script(type='text/javascript', src='http://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js')
with doc:
div(cls='container')
h1('Sesiones')
div(cls='page-header')
for url in urls:
result = requests.get(url, verify=False)
results.append(result)
div(img(src='http://dummyimage.com/230x100/000/fff&text=' + result.text, _class='thumbnail img-responsive'), _class='col-md-4')
with open('index.html', 'w') as f:
f.write(doc.render())