Commit c41b2155 authored by Virgile Gerecke's avatar Virgile Gerecke 🤘
Browse files

Merge branch 'release/2.0.1'

parents 74771d1d 38c9ef1b
Pipeline #14790 passed with stage
in 39 seconds
stages:
- test
- deploy
unittest:
stage: test
......@@ -10,3 +11,18 @@ unittest:
- python3 verify.py
- python3 display.py
pages:
stage: deploy
script:
- pip3 install -r requirements.txt
- python3 rss.py
- mkdir target
- mv rss.xml target
- mv atom.xml target
- mv target public
artifacts:
paths:
- public
only:
- master
from feedgen.feed import FeedGenerator
from slugify import slugify
from json import load
import dateutil.parser
data = load(open('weather.json','r'))
def df(date):
dt = dateutil.parser.parse(date)
return dt.strftime("%d/%m/%Y à %Hh%M")
fg = FeedGenerator()
fg.id('https://support.unistra.fr/')
fg.title('Maintenance des services numériques')
fg.subtitle('Annonces de la Direction du Numérique')
fg.link(href='https://support.unistra.fr/#go-weather')
fg.language('fr')
fg.link(href='https://support.unistra.fr/atom.php', rel='self')
fg.author(name='Direction du Numérique', email='support@unistra.fr')
fg.logo('http://www.unistra.fr/fileadmin/templates/unistra/images/uds_ico.ico')
for item in data:
fe = fg.add_entry()
title=item['title']
fe.title(title)
fe.id(slugify(title))
content = "<p><b>Date de début : </b>{}</p><p><b>Date de fin : </b>{}</p>{}".format(df(item['start']), df(item['end']), item['content'])
fe.description(content)
fe.pubDate(item['start'])
rssfeed = fg.rss_str(pretty=True)
fg.rss_file('rss.xml')
atomfeed = fg.atom_str(pretty=True)
fg.atom_file('atom.xml')
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment