fabianehlert / htwcampus

Official iOS app of the University of Applied Sciences Dresden.
https://www.htw-dresden.de
MIT License
15 stars 2 forks source link

Improve Mensa data #21

Closed kiliankoe closed 7 years ago

kiliankoe commented 7 years ago

As described in https://github.com/HTWDD/htwcampus/commit/21d1e25aa87bb1e16aaca8b37cfd3bc6fb10d1e3#commitcomment-25267480

Android Implementation: https://github.com/HTWDD/HTWDresden/blob/master/app/src/main/java/de/htwdd/htwdresden/types/Meal.java#L60-L73

kiliankoe commented 7 years ago

Is it necessary to get meals for anything but the current day? Just threw some rss feed parsing into StuWeDD to enable fetching of current meal data. Unfortunately the feed only exists for the current day afaict (I sent a mail inquiring about this though).

It includes the following data 😊

public struct Meal {
    public let id: String
    public let name: String
    public let mensa: String
    public let price: Price?
    public let url: URL
    public let imageURL: URL?
    public let isSoldOut: Bool

    public struct Price {
        public let student: Double
        public let employee: Double
    }

    public static func fetch(session: URLSession = default, completion: @escaping (Result<[Meal]>) -> Void)
    public static func fetch(forMensa mensa: String, session: URLSession = default, completion: @escaping (Result<[Meal]>) -> Void)
}
BenchR267 commented 7 years ago

Does the rss feed for the current day even contain all information? I think it would be great to have additional informations like allergy information as well (which is currently not part of the feed afaik. Maybe even more important: price!

kiliankoe commented 7 years ago

Unfortunately ingredients/allergens aren't listed, that's correct 😢 Price is there though.

Will look into the best way of getting as much data as possible 😊