Fix and make the rss available via /apps.rss

This commit is contained in:
Alexandre Aubin 2018-05-29 17:28:28 +00:00
parent c5addbd8ea
commit f579dad5b3
2 changed files with 8 additions and 1 deletions

View file

@ -27,6 +27,13 @@ def applist_history():
data = json.loads(open("./app/scripts/appListsHistory/count_history.json").read())
return render_template('applist_history.html', data=data)
@main.route('/apps.rss')
def apps_rss():
file_ = open("./app/scripts/appListsHistory/atom.xml").read()
response = make_response(file_)
response.headers['Content-Type'] = 'application/rss+xml'
return response
@main.route('/pullrequests')
def pullrequests():

View file

@ -120,7 +120,7 @@ def make_rss_feed():
for diff in diffs():
fe = fg.add_entry()
fe.id(diff["end"].strftime("%y-%m-%d"))
fe.id('https://github.com/YunoHost/Apps/#'+diff["end"].strftime("%y-%m-%d"))
fe.title('Changes between %s and %s' % (diff["begin"].strftime("%b %d"), diff["end"].strftime("%b %d")))
fe.link(href='https://github.com/YunoHost/apps/commits/master/community.json')
fe.content(jinja2.Template(open("rss_template.html").read()).render(data=diff), type="html")