Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RSS Feed #18

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/en/cfp.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@


<link rel="alternate" href="https://2020.pycon.sk/sk/cfp.html" hreflang="sk">
<link rel="alternate" type="application/rss+xml" title="Subscribe to RSS feed" href="https://2020.pycon.sk/en/feed.rss" />

<link rel="canonical" href="https://2020.pycon.sk/en/cfp.html"/>
<!-- Custom Js -->
Expand Down
1 change: 1 addition & 0 deletions docs/en/cfp_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@


<link rel="alternate" href="https://2020.pycon.sk/sk/cfp_form.html" hreflang="sk">
<link rel="alternate" type="application/rss+xml" title="Subscribe to RSS feed" href="https://2020.pycon.sk/en/feed.rss" />

<link rel="canonical" href="https://2020.pycon.sk/en/cfp_form.html"/>
<!-- Custom Js -->
Expand Down
1 change: 1 addition & 0 deletions docs/en/cfv.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@


<link rel="alternate" href="https://2020.pycon.sk/sk/cfv.html" hreflang="sk">
<link rel="alternate" type="application/rss+xml" title="Subscribe to RSS feed" href="https://2020.pycon.sk/en/feed.rss" />

<link rel="canonical" href="https://2020.pycon.sk/en/cfv.html"/>
<!-- Custom Js -->
Expand Down
1 change: 1 addition & 0 deletions docs/en/coc.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@


<link rel="alternate" href="https://2020.pycon.sk/sk/coc.html" hreflang="sk">
<link rel="alternate" type="application/rss+xml" title="Subscribe to RSS feed" href="https://2020.pycon.sk/en/feed.rss" />

<link rel="canonical" href="https://2020.pycon.sk/en/coc.html"/>
<!-- Custom Js -->
Expand Down
1 change: 1 addition & 0 deletions docs/en/countdown.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@


<link rel="alternate" href="https://2020.pycon.sk/sk/countdown.html" hreflang="sk">
<link rel="alternate" type="application/rss+xml" title="Subscribe to RSS feed" href="https://2020.pycon.sk/en/feed.rss" />

<link rel="canonical" href="https://2020.pycon.sk/en/countdown.html"/>
<!-- Custom Js -->
Expand Down
44 changes: 44 additions & 0 deletions docs/en/feed.rss
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">

<channel>
<atom:link href="https://2020.pycon.sk/en/feed.rss" rel="self" type="application/rss+xml" />
<title>PyCon SK 2020 Newsroom</title>
<link>https://2020.pycon.sk/en/news.html</link>
<description>News from PyCon Sk 2020 community conference</description>
<language>en</language>
<item>
<title>Conference chat.</title>
<link>https://join.slack.com/t/pyconsk/shared_invite/enQtODQ4NjU1NzM2NzI3LTA2ZGNiOTA4YzM5OWM3NmQyZjAxMDlmNzJjOGIzNjM4ZjEwZGI0MTJiYzAxZmNhZmVjMTZjZjliNWQ4ZjVlNjE</link>
<description>Last year we have used Slack as our conference chat so you can get in touch with organizers and also with fellow participants. For PyCon SK 2020 chat we are going to use the Slack.</description>
<pubDate>Sat, 23 Nov 2019 00:00:00 +0100</pubDate>
<guid isPermaLink="false">X1297842880833849801</guid>
<category>media</category>
</item>
<item>
<title>First batch of speakers.</title>
<link>https://2020.pycon.sk</link>
<description>We are honoured to announce the first batch of speakers that will be part of PyCon SK 2020.</description>
<pubDate>Sat, 16 Nov 2019 00:00:00 +0100</pubDate>
<guid isPermaLink="false">X7011295520301786405</guid>
<category>speakers</category>
</item>
<item>
<title>We celebrate the Day of Fighting for Freedom and Democracy.</title>
<link>https://en.wikipedia.org/wiki/Velvet_Revolution</link>
<description>On 17th November we celebrate the Day of Fighting for Freedom and Democracy. Thanks to this event we can freely organize PyCon SK. We want you to celebrate with us. During the holiday you can use 17% discount for tickets using discount code &#34;30-rokov-slobody&#34;.</description>
<pubDate>Fri, 15 Nov 2019 00:00:00 +0100</pubDate>
<guid isPermaLink="false">1930167262659116288</guid>
<category>conference</category>
</item>
<item>
<title>The Call for Proposals is open!</title>
<link>https://2020.pycon.sk/en/cfp.html</link>
<description>Do you know anyone in underrepresented group in IT who would like to do a conference talk? Let us know, and try to encourage him/her to submit Call for Proposals for PyCon SK 2020. We are trying to support diversity. Anyone can be part of the conference.</description>
<pubDate>Sun, 20 Oct 2019 00:00:00 +0100</pubDate>
<guid isPermaLink="false">2475977916832491908</guid>
<category>speakers</category>
</item>
</channel>

</rss>
1 change: 1 addition & 0 deletions docs/en/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@


<link rel="alternate" href="https://2020.pycon.sk/sk/index.html" hreflang="sk">
<link rel="alternate" type="application/rss+xml" title="Subscribe to RSS feed" href="https://2020.pycon.sk/en/feed.rss" />

<link rel="canonical" href="https://2020.pycon.sk/en/index.html"/>
<!-- Custom Js -->
Expand Down
1 change: 1 addition & 0 deletions docs/en/news.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@


<link rel="alternate" href="https://2020.pycon.sk/sk/news.html" hreflang="sk">
<link rel="alternate" type="application/rss+xml" title="Subscribe to RSS feed" href="https://2020.pycon.sk/en/feed.rss" />

<link rel="canonical" href="https://2020.pycon.sk/en/news.html"/>
<!-- Custom Js -->
Expand Down
1 change: 1 addition & 0 deletions docs/en/news/conference.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@


<link rel="alternate" href="https://2020.pycon.sk/sk/news/conference.html" hreflang="sk">
<link rel="alternate" type="application/rss+xml" title="Subscribe to RSS feed" href="https://2020.pycon.sk/en/feed.rss" />

<link rel="canonical" href="https://2020.pycon.sk/en/news/conference.html"/>
<!-- Custom Js -->
Expand Down
1 change: 1 addition & 0 deletions docs/en/news/media.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@


<link rel="alternate" href="https://2020.pycon.sk/sk/news/media.html" hreflang="sk">
<link rel="alternate" type="application/rss+xml" title="Subscribe to RSS feed" href="https://2020.pycon.sk/en/feed.rss" />

<link rel="canonical" href="https://2020.pycon.sk/en/news/media.html"/>
<!-- Custom Js -->
Expand Down
1 change: 1 addition & 0 deletions docs/en/news/speakers.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@


<link rel="alternate" href="https://2020.pycon.sk/sk/news/speakers.html" hreflang="sk">
<link rel="alternate" type="application/rss+xml" title="Subscribe to RSS feed" href="https://2020.pycon.sk/en/feed.rss" />

<link rel="canonical" href="https://2020.pycon.sk/en/news/speakers.html"/>
<!-- Custom Js -->
Expand Down
1 change: 1 addition & 0 deletions docs/en/privacy-policy.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@


<link rel="alternate" href="https://2020.pycon.sk/sk/privacy-policy.html" hreflang="sk">
<link rel="alternate" type="application/rss+xml" title="Subscribe to RSS feed" href="https://2020.pycon.sk/en/feed.rss" />

<link rel="canonical" href="https://2020.pycon.sk/en/privacy-policy.html"/>
<!-- Custom Js -->
Expand Down
1 change: 1 addition & 0 deletions docs/en/recording.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@


<link rel="alternate" href="https://2020.pycon.sk/sk/recording.html" hreflang="sk">
<link rel="alternate" type="application/rss+xml" title="Subscribe to RSS feed" href="https://2020.pycon.sk/en/feed.rss" />

<link rel="canonical" href="https://2020.pycon.sk/en/recording.html"/>
<!-- Custom Js -->
Expand Down
1 change: 1 addition & 0 deletions docs/en/thanks.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@


<link rel="alternate" href="https://2020.pycon.sk/sk/thanks.html" hreflang="sk">
<link rel="alternate" type="application/rss+xml" title="Subscribe to RSS feed" href="https://2020.pycon.sk/en/feed.rss" />

<link rel="canonical" href="https://2020.pycon.sk/en/thanks.html"/>
<!-- Custom Js -->
Expand Down
1 change: 1 addition & 0 deletions docs/en/tickets.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@


<link rel="alternate" href="https://2020.pycon.sk/sk/tickets.html" hreflang="sk">
<link rel="alternate" type="application/rss+xml" title="Subscribe to RSS feed" href="https://2020.pycon.sk/en/feed.rss" />

<link rel="canonical" href="https://2020.pycon.sk/en/tickets.html"/>
<!-- Custom Js -->
Expand Down
1 change: 1 addition & 0 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@


<link rel="alternate" href="https://2020.pycon.sk/en/index.html" hreflang="en">
<link rel="alternate" type="application/rss+xml" title="Odoberať RSS" href="https://2020.pycon.sk/sk/feed.rss" />

<link rel="canonical" href="https://2020.pycon.sk/sk/index.html"/>
<!-- Custom Js -->
Expand Down
10 changes: 10 additions & 0 deletions docs/sitemap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@
<loc>https://2020.pycon.sk/en/cfv.html</loc>
<lastmod>2020-01-04</lastmod>
</url>

<url>
<loc>https://2020.pycon.sk/en/feed.rss</loc>
<lastmod>2020-01-04</lastmod>
</url>

<url>
<loc>https://2020.pycon.sk/</loc>
Expand Down Expand Up @@ -150,5 +155,10 @@
<loc>https://2020.pycon.sk/sk/cfv.html</loc>
<lastmod>2020-01-04</lastmod>
</url>

<url>
<loc>https://2020.pycon.sk/sk/feed.rss</loc>
<lastmod>2020-01-04</lastmod>
</url>

</urlset>
1 change: 1 addition & 0 deletions docs/sk/cfp.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@


<link rel="alternate" href="https://2020.pycon.sk/en/cfp.html" hreflang="en">
<link rel="alternate" type="application/rss+xml" title="Odoberať RSS" href="https://2020.pycon.sk/sk/feed.rss" />

<link rel="canonical" href="https://2020.pycon.sk/sk/cfp.html"/>
<!-- Custom Js -->
Expand Down
1 change: 1 addition & 0 deletions docs/sk/cfp_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@


<link rel="alternate" href="https://2020.pycon.sk/en/cfp_form.html" hreflang="en">
<link rel="alternate" type="application/rss+xml" title="Odoberať RSS" href="https://2020.pycon.sk/sk/feed.rss" />

<link rel="canonical" href="https://2020.pycon.sk/sk/cfp_form.html"/>
<!-- Custom Js -->
Expand Down
1 change: 1 addition & 0 deletions docs/sk/cfv.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@


<link rel="alternate" href="https://2020.pycon.sk/en/cfv.html" hreflang="en">
<link rel="alternate" type="application/rss+xml" title="Odoberať RSS" href="https://2020.pycon.sk/sk/feed.rss" />

<link rel="canonical" href="https://2020.pycon.sk/sk/cfv.html"/>
<!-- Custom Js -->
Expand Down
1 change: 1 addition & 0 deletions docs/sk/coc.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@


<link rel="alternate" href="https://2020.pycon.sk/en/coc.html" hreflang="en">
<link rel="alternate" type="application/rss+xml" title="Odoberať RSS" href="https://2020.pycon.sk/sk/feed.rss" />

<link rel="canonical" href="https://2020.pycon.sk/sk/coc.html"/>
<!-- Custom Js -->
Expand Down
1 change: 1 addition & 0 deletions docs/sk/countdown.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@


<link rel="alternate" href="https://2020.pycon.sk/en/countdown.html" hreflang="en">
<link rel="alternate" type="application/rss+xml" title="Odoberať RSS" href="https://2020.pycon.sk/sk/feed.rss" />

<link rel="canonical" href="https://2020.pycon.sk/sk/countdown.html"/>
<!-- Custom Js -->
Expand Down
44 changes: 44 additions & 0 deletions docs/sk/feed.rss
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">

<channel>
<atom:link href="https://2020.pycon.sk/sk/feed.rss" rel="self" type="application/rss+xml" />
<title>Novinky z PyCon SK 2020</title>
<link>https://2020.pycon.sk/sk/news.html</link>
<description>Novinky z komunitnej konferencie PyCon SK</description>
<language>sk</language>
<item>
<title>Konferenčný chat.</title>
<link>https://join.slack.com/t/pyconsk/shared_invite/enQtODQ4NjU1NzM2NzI3LTA2ZGNiOTA4YzM5OWM3NmQyZjAxMDlmNzJjOGIzNjM4ZjEwZGI0MTJiYzAxZmNhZmVjMTZjZjliNWQ4ZjVlNjE</link>
<description>Minulý rok sme používali Slack ako konferenčný chat, pomocou ktorého ste mohli komunikovať s organizátormi a aj s ďalšími účastníkmi. Aj na PyCon SK 2020 budeme používať Slack.</description>
<pubDate>Sat, 23 Nov 2019 00:00:00 +0100</pubDate>
<guid isPermaLink="false">X9117983569691494731</guid>
<category>media</category>
</item>
<item>
<title>Prvá várka rečníkov.</title>
<link>https://2020.pycon.sk</link>
<description>Je nám cťou predstaviť prvých potvrdených rečníkov na PyCon SK 2020.</description>
<pubDate>Sat, 16 Nov 2019 00:00:00 +0100</pubDate>
<guid isPermaLink="false">9157616666749676994</guid>
<category>speakers</category>
</item>
<item>
<title>Oslavujeme Deň boja za slobodu a demokraciu.</title>
<link>https://en.wikipedia.org/wiki/Velvet_Revolution</link>
<description>17. novembra oslavujeme Deň boja za slobodu a demokraciu. Vďaka tejto udalosti môžeme slobodne organizovať PyCon SK. Chceme, aby ste oslavovali aj vy. Počas celého sviatku môže využiť zľavu 17% na lístky s promo kódom &#34;30-rokov-slobody&#34;.</description>
<pubDate>Fri, 15 Nov 2019 00:00:00 +0100</pubDate>
<guid isPermaLink="false">9056812806562436807</guid>
<category>conference</category>
</item>
<item>
<title>Predkladanie prednášok a workshopov je otvorené!</title>
<link>https://2020.pycon.sk/en/cfp.html</link>
<description>Poznáš niekoho z málo zastúpenej skupiny v IT, kto by chcel urobiť prednášku na konferencii? Daj nám vedieť a povzbuď ho/ju, aby si podal/a návrh na prednášku na PyCon SK 2020. Snažíme sa podporovať rôznorodosť.</description>
<pubDate>Sun, 20 Oct 2019 00:00:00 +0100</pubDate>
<guid isPermaLink="false">7258377453004018800</guid>
<category>speakers</category>
</item>
</channel>

</rss>
1 change: 1 addition & 0 deletions docs/sk/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@


<link rel="alternate" href="https://2020.pycon.sk/en/index.html" hreflang="en">
<link rel="alternate" type="application/rss+xml" title="Odoberať RSS" href="https://2020.pycon.sk/sk/feed.rss" />

<link rel="canonical" href="https://2020.pycon.sk/sk/index.html"/>
<!-- Custom Js -->
Expand Down
1 change: 1 addition & 0 deletions docs/sk/news.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@


<link rel="alternate" href="https://2020.pycon.sk/en/news.html" hreflang="en">
<link rel="alternate" type="application/rss+xml" title="Odoberať RSS" href="https://2020.pycon.sk/sk/feed.rss" />

<link rel="canonical" href="https://2020.pycon.sk/sk/news.html"/>
<!-- Custom Js -->
Expand Down
1 change: 1 addition & 0 deletions docs/sk/news/conference.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@


<link rel="alternate" href="https://2020.pycon.sk/en/news/conference.html" hreflang="en">
<link rel="alternate" type="application/rss+xml" title="Odoberať RSS" href="https://2020.pycon.sk/sk/feed.rss" />

<link rel="canonical" href="https://2020.pycon.sk/sk/news/conference.html"/>
<!-- Custom Js -->
Expand Down
1 change: 1 addition & 0 deletions docs/sk/news/media.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@


<link rel="alternate" href="https://2020.pycon.sk/en/news/media.html" hreflang="en">
<link rel="alternate" type="application/rss+xml" title="Odoberať RSS" href="https://2020.pycon.sk/sk/feed.rss" />

<link rel="canonical" href="https://2020.pycon.sk/sk/news/media.html"/>
<!-- Custom Js -->
Expand Down
1 change: 1 addition & 0 deletions docs/sk/news/speakers.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@


<link rel="alternate" href="https://2020.pycon.sk/en/news/speakers.html" hreflang="en">
<link rel="alternate" type="application/rss+xml" title="Odoberať RSS" href="https://2020.pycon.sk/sk/feed.rss" />

<link rel="canonical" href="https://2020.pycon.sk/sk/news/speakers.html"/>
<!-- Custom Js -->
Expand Down
1 change: 1 addition & 0 deletions docs/sk/privacy-policy.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@


<link rel="alternate" href="https://2020.pycon.sk/en/privacy-policy.html" hreflang="en">
<link rel="alternate" type="application/rss+xml" title="Odoberať RSS" href="https://2020.pycon.sk/sk/feed.rss" />

<link rel="canonical" href="https://2020.pycon.sk/sk/privacy-policy.html"/>
<!-- Custom Js -->
Expand Down
1 change: 1 addition & 0 deletions docs/sk/recording.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@


<link rel="alternate" href="https://2020.pycon.sk/en/recording.html" hreflang="en">
<link rel="alternate" type="application/rss+xml" title="Odoberať RSS" href="https://2020.pycon.sk/sk/feed.rss" />

<link rel="canonical" href="https://2020.pycon.sk/sk/recording.html"/>
<!-- Custom Js -->
Expand Down
1 change: 1 addition & 0 deletions docs/sk/thanks.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@


<link rel="alternate" href="https://2020.pycon.sk/en/thanks.html" hreflang="en">
<link rel="alternate" type="application/rss+xml" title="Odoberať RSS" href="https://2020.pycon.sk/sk/feed.rss" />

<link rel="canonical" href="https://2020.pycon.sk/sk/thanks.html"/>
<!-- Custom Js -->
Expand Down
1 change: 1 addition & 0 deletions docs/sk/tickets.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@


<link rel="alternate" href="https://2020.pycon.sk/en/tickets.html" hreflang="en">
<link rel="alternate" type="application/rss+xml" title="Odoberať RSS" href="https://2020.pycon.sk/sk/feed.rss" />

<link rel="canonical" href="https://2020.pycon.sk/sk/tickets.html"/>
<!-- Custom Js -->
Expand Down
23 changes: 13 additions & 10 deletions pycon.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,8 @@
from flask import Flask, g, request, render_template, abort, make_response, url_for, redirect
from flask_babel import Babel, gettext, lazy_gettext

from utils import get_news, get_speakers

EVENT = gettext('PyCon SK 2020 | 27 - 29 March 2020 | Bratislava, Slovakia')
DOMAIN = 'https://2020.pycon.sk'
API_DOMAIN = 'https://api.pycon.sk'

LANGS = ('en', 'sk')
TIME_FORMAT = '%Y-%m-%dT%H:%M:%S+00:00'
from settings import EVENT, DOMAIN, API_DOMAIN, LANGUAGES, TIME_FORMAT
from utils import get_news, get_rss, get_speakers

app = Flask(__name__, static_url_path='/static') # pylint: disable=invalid-name
app.config['BABEL_DEFAULT_LOCALE'] = 'sk'
Expand All @@ -32,7 +26,7 @@ def sitemap():
excluded = {'static', 'sitemap'}
pages = []

for lang in LANGS:
for lang in LANGUAGES:
for rule in app.url_map.iter_rules():

if 'GET' in rule.methods and rule.endpoint not in excluded:
Expand Down Expand Up @@ -134,6 +128,15 @@ def countdown():
return render_template('countdown.html', **template_vars)


@app.route('/<lang_code>/feed.rss')
def rss_feed():
rss_content = get_rss(get_locale())
rss_xml = render_template('rss.xml', **rss_content)
response = make_response(rss_xml)
response.headers['Content-Type'] = 'application/x-rss+xml'
return response


def _get_template_variables(**kwargs):
"""Collect variables for template that repeats, e.g. are in body.html template"""
variables = {
Expand All @@ -150,7 +153,7 @@ def _get_template_variables(**kwargs):
def before(): # pylint: disable=inconsistent-return-statements
if request.view_args and 'lang_code' in request.view_args:
g.current_lang = request.view_args['lang_code']
if request.view_args['lang_code'] not in LANGS:
if request.view_args['lang_code'] not in LANGUAGES:
return abort(404)
request.view_args.pop('lang_code')

Expand Down
Loading