update look, add SMS RSS
This commit is contained in:
parent
eced139c70
commit
85d197b762
23
web/app.py
23
web/app.py
@ -2346,6 +2346,29 @@ TG #: <strong> ''' + str(tg_d.tg) + '''</strong>
|
|||||||
|
|
||||||
return render_template('tg_all.html', markup_content = Markup(content))
|
return render_template('tg_all.html', markup_content = Markup(content))
|
||||||
|
|
||||||
|
@app.route('/sms.xml')
|
||||||
|
def rss_sms():
|
||||||
|
rss_header = """<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<rss version="2.0">
|
||||||
|
<channel>
|
||||||
|
<title>""" + title + """ - SMS Feed</title>
|
||||||
|
<link>""" + url + """/sms</link>
|
||||||
|
<description>This is a feed of all SMS received.</description>"""
|
||||||
|
smsl = SMSLog.query.order_by(SMSLog.time.desc()).all()
|
||||||
|
content = ''' '''
|
||||||
|
for i in smsl:
|
||||||
|
content = content + """
|
||||||
|
<item>
|
||||||
|
<title>To: """ + i.rcv_callsign + ' (' + str(i.rcv_id) + ') - From: ' + i.snd_callsign + """ (""" + str(i.snd_id) + """</title>
|
||||||
|
<link>""" + url + """/sms</link>
|
||||||
|
<description>""" + i.message + """ - """ + str(i.time.strftime(time_format)) + """</description>
|
||||||
|
<pubDate>""" + i.time.strftime('%a, %d %b %y') +"""</pubDate>
|
||||||
|
</item>
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
return Response(rss_header + content + "\n</channel>\n</rss>", mimetype='text/xml')
|
||||||
|
|
||||||
@app.route('/sms')
|
@app.route('/sms')
|
||||||
def all_sms():
|
def all_sms():
|
||||||
smsl = SMSLog.query.order_by(SMSLog.time.desc()).all()
|
smsl = SMSLog.query.order_by(SMSLog.time.desc()).all()
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
<h1 style="text-align: center;">Bulletin Board</h1>
|
<h1 style="text-align: center;">Bulletin Board</h1>
|
||||||
<p style="text-align: center;"><a href="bulletin_rss.xml"><em>Bulletin Board RSS Feed</em></a><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAC4jAAAuIwF4pT92AAAAB3RJTUUH5QIcFBAOXAevLAAAAZZJREFUSMftlbtKA0EUhj8jWhi8gaIEC29oxEoRFESLgIXYiWVSKoj6CCrBBwj6CBHNE1hEWy21ETQqiIW1wXhPo81ZOBw2apbdVPvDsDPnP8M/5zKzECJEQKivYO8DFoAYEAGKtTpQEvhW4w3IA+tAVy2F9fgEskA8COHUL8LOKAMZoMmLQF0FewcwImmNAzPANBB18b0BFoGroNLfBiyLgI2+BMwF3XgNwCrwYsQ//BBPSRPdAoeybjE+A8ClS+Sjfnf1E5A2dW4FzoxfwWvD/XWd7oAxI24jz3gVnpS7eiEpt+KvQEL5D5qal/245zFgU+pnXzMd+Zrh9/3q5l7g3CXtTs0bgWvFffn5vDa7iKcVv2K4DS8i3cAOsAuMm8h12ovqqrVL/R3upFrRKPBgHgctvm0iSynuWNnf5bf6byy5dPKe4nukhg6XU9yW2TfsJlDpNCUX27OaP8pD4WBCzQtmX381EUeAI3Xqe6m5xoHpYAezJuJkNb9Fh0tI4+SlXhpTwJBaZ+XbCcwr+6kcPESI2uAHmAijFaMnEmYAAAAASUVORK5CYII=" /></p>
|
<p style="text-align: center;"><a href="bulletin_rss.xml"><em>RSS Feed</em></a><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAC4jAAAuIwF4pT92AAAAB3RJTUUH5QIcFBAOXAevLAAAAZZJREFUSMftlbtKA0EUhj8jWhi8gaIEC29oxEoRFESLgIXYiWVSKoj6CCrBBwj6CBHNE1hEWy21ETQqiIW1wXhPo81ZOBw2apbdVPvDsDPnP8M/5zKzECJEQKivYO8DFoAYEAGKtTpQEvhW4w3IA+tAVy2F9fgEskA8COHUL8LOKAMZoMmLQF0FewcwImmNAzPANBB18b0BFoGroNLfBiyLgI2+BMwF3XgNwCrwYsQ//BBPSRPdAoeybjE+A8ClS+Sjfnf1E5A2dW4FzoxfwWvD/XWd7oAxI24jz3gVnpS7eiEpt+KvQEL5D5qal/245zFgU+pnXzMd+Zrh9/3q5l7g3CXtTs0bgWvFffn5vDa7iKcVv2K4DS8i3cAOsAuMm8h12ovqqrVL/R3upFrRKPBgHgctvm0iSynuWNnf5bf6byy5dPKe4nukhg6XU9yW2TfsJlDpNCUX27OaP8pD4WBCzQtmX381EUeAI3Xqe6m5xoHpYAezJuJkNb9Fh0tI4+SlXhpTwJBaZ+XbCcwr+6kcPESI2uAHmAijFaMnEmYAAAAASUVORK5CYII=" /></p>
|
||||||
|
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
@ -2,6 +2,8 @@
|
|||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
<h1 style="text-align: center;">SMS Log</h1>
|
<h1 style="text-align: center;">SMS Log</h1>
|
||||||
|
<p style="text-align: center;"><a href="/sms.xml"><em>RSS Feed</em></a><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAC4jAAAuIwF4pT92AAAAB3RJTUUH5QIcFBAOXAevLAAAAZZJREFUSMftlbtKA0EUhj8jWhi8gaIEC29oxEoRFESLgIXYiWVSKoj6CCrBBwj6CBHNE1hEWy21ETQqiIW1wXhPo81ZOBw2apbdVPvDsDPnP8M/5zKzECJEQKivYO8DFoAYEAGKtTpQEvhW4w3IA+tAVy2F9fgEskA8COHUL8LOKAMZoMmLQF0FewcwImmNAzPANBB18b0BFoGroNLfBiyLgI2+BMwF3XgNwCrwYsQ//BBPSRPdAoeybjE+A8ClS+Sjfnf1E5A2dW4FzoxfwWvD/XWd7oAxI24jz3gVnpS7eiEpt+KvQEL5D5qal/245zFgU+pnXzMd+Zrh9/3q5l7g3CXtTs0bgWvFffn5vDa7iKcVv2K4DS8i3cAOsAuMm8h12ovqqrVL/R3upFrRKPBgHgctvm0iSynuWNnf5bf6byy5dPKe4nukhg6XU9yW2TfsJlDpNCUX27OaP8pD4WBCzQtmX381EUeAI3Xqe6m5xoHpYAezJuJkNb9Fh0tI4+SlXhpTwJBaZ+XbCcwr+6kcPESI2uAHmAijFaMnEmYAAAAASUVORK5CYII=" /></p>
|
||||||
|
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-lg-12">
|
<div class="col-lg-12">
|
||||||
|
Loading…
Reference in New Issue
Block a user