Commit 59c4b78c authored by Kiste's avatar Kiste
Browse files

Cleanup

parent 4bff8063
#!/usr/bin/env python3
from studfeed.main import main
main()
......@@ -7,13 +7,13 @@ published by Sam Hocevar. See http://www.wtfpl.net/ for more details.
"""
import argparse
import json
import os
from feedgen.feed import FeedGenerator
import requests
from feedgen.feed import FeedGenerator
BASEURL = 'https://studip.uni-hannover.de/plugins.php/restipplugin/api'
def main():
parser = argparse.ArgumentParser()
parser.add_argument('-u', '--user', help='Stud.IP Benutzername', required=True)
......@@ -45,7 +45,8 @@ def main():
juser = session.get(BASEURL + '/user/' + news['user_id'])
author = juser.json()['user']
fe = fg.add_entry()
fe.author(name=str.join(' ', filter(None, (author['title_pre'], author['forename'], author['lastname']))), email=author['email'])
fe.author(name=str.join(' ', filter(None, (author['title_pre'], author['forename'], author['lastname']))),
email=author['email'])
fe.content(news['body'], type='html')
fe.id(news['news_id'])
fe.published(news['iso_mkdate'])
......
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