-
Notifications
You must be signed in to change notification settings - Fork 45
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
New Parser for TU-Dortmund and FH-Suedwestfalen #88
Conversation
Ok test failed, because my parser needs the python module "requests". |
Just replace |
Thanks for the advice @klemens ! |
Thanks! If you want to rerun travis, just I will take a look at the changes this weekend. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks again for writing this parser and sorry for the delay. This looks quite good already! The automatic legend extraction is not working currently, but this easy to fix. Apart from that, there are only some minor things that can be improved.
elif 'price'in item['class']: | ||
price = item.text | ||
if 'student' in item['class']: | ||
student_price = getAndFormatPrice(price) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I saw in your commits, that you removed the getAndFormatPrice
function and then added it back. I just tested it myself and the convertPrice
function in feed.py seems to properly extract all prices. Were there some problems with just passing the string directly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, you are right I removed the function, but then I realised again why I put it in in the first place. There are some meals (I guess only side dishes), where there is no price given. The standard parsing of the prices breaks at that point, so I implemented my method to handle empty prices.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right. Seems like we should make convertPrice
a little bit more flexible. 😅 Do you remember an example where there were no prices given?
Thanks for the changes. This is almost ready to be merged. After this has been merged, we have to add the parser and the contained canteens to the openmensa.org site. Do you want do this with your own account (you will get the emails if something breaks) or do you prefer if I add the parser to my account? |
Sure, I can add the parser myself. There is a tutorial for that on the website, right? |
I merged this (sqashed into one commit) into the master branch, which means that it should become available at When adding the canteens (including address etc.) make sure to use the same name as in the parser (like |
Unfortunately, the parser update is still broken: #89 However, as this is a new parser, I can offer you to host the parser at my own server for now. |
Sorry for the long delay 😞, but I have good news. I am now hosting the parsers on my own server: https://omfeeds.crpt.de/dortmund/index.json So feel free to create the parser on openmensa.org. If you have any questions, just ping me. |
No worries, I've had a lot to do lately so the parser had a not so high priority for me. |
Looks good! The kostBar currently has a meal with an empty name, which is not allowed and leads to the following error:
We should just ignore meals with an empty name. |
I wrote a parser for the canteens that the Studierendenwerk Dortmund is working for. The parser can parse all canteens of the TU-Dortmund, FH Dortmund, ISM Dortmund, FH Suedwestfalen and FernUni Hagen.