Merge branch 'master' of git.wmi.amu.edu.pl:s434776/PRI_2020-FE

This commit is contained in:
Michał Romaszkin 2020-05-07 15:37:39 +02:00
commit 8e638e3037

View File

@ -26,10 +26,16 @@ def parseData(file):
out['discussions'] = []
for d in soup.forum.find_all('discussion'):
out['discussions'].append({
'id': d.get('id'),
'title': d.find('name').text,
'posts': [
{'id': p.get('id'), 'author': p.userid.text,
'message': p.message.get_text()} for p in d.find_all('post')]
})
'id': d.get('id'),
'title': d.find('name').text,
'first_post': d.firstpost.text,
'posts': [
{
'id': p.get('id'),
'parent': p.find('parent').text,
'author': p.userid.text,
'message': p.message.get_text()
} for p in d.find_all('post')]
})
return(out)