rafatjah's picture
- Qr code
780c5da
import streamlit as st
import uuid
import os
import streamlit.components.v1 as components
@st.cache_resource
def load_polls():
return []
def find_poll(poll_name):
for poll in load_polls():
if poll["name"] == poll_name:
return poll
return None
def generate_uuid():
return uuid.uuid4()
def get_options():
return [
"Low Pace",
"Good Pace",
"Fast Pace",
"Have Question",
"Missed a Point",
"Need a brake",
]
def get_base_url():
return os.getenv("BASE_URL", default="https://example.com")
def generate_qr_code_image_link(poll_name):
link = f"https://quickchart.io/qr?text={get_base_url()}%2F%3Fpoll%3D{poll_name}&ecLevel=Q&size=1000&format=svg"
return link
def statistics():
st.write("---")
columns = st.columns(5)
with columns[2]:
components.html(
""" <!-- Histats.com (div with counter) --><div id="histats_counter"></div>
<!-- Histats.com START (aync)-->
<script type="text/javascript">var _Hasync= _Hasync|| [];
_Hasync.push(['Histats.start', '1,4880407,4,9,110,60,00011111']);
_Hasync.push(['Histats.fasi', '1']);
_Hasync.push(['Histats.track_hits', '']);
(function() {
var hs = document.createElement('script'); hs.type = 'text/javascript'; hs.async = true;
hs.src = ('//s10.histats.com/js15_as.js');
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(hs);
})();</script>
<noscript><a href="/" target="_blank"><img src="//sstatic1.histats.com/0.gif?4880407&101" alt="hidden hit counter" border="0"></a></noscript>
<!-- Histats.com END -->"""
)