Fixing Sold Out Detection In The MensaDD App
Hey guys! So, we've got a bit of a snag. The sold out feature in the awesome MensaDD app seems to have hit a snag. Our friend, kiliankoe, pointed out that the app isn't showing the sold-out status anymore. Bummer, right? It was super helpful for knowing what's available and what's not. Let's dive in and see what's going on and how we can get this fixed. We'll explore the problem, the potential solutions, and why this is a real head-scratcher.
The Problem: Where Did the Sold Out Status Go?
So, what's the deal? The MensaDD app used to smartly detect when a meal was sold out by looking at the meal's title. This was a clever way to quickly figure out availability. But, it looks like the clever method has been foiled. The studentenwerk-dresden.de folks have changed things up, and the 'sold out' info is no longer in the title. This means the app is missing this crucial piece of data. This change means the app's functionality is compromised, and users are left guessing about meal availability. The impact is definitely a reduction in user experience. It creates the need for the user to visit a webpage, or assume that a meal is available.
kiliankoe did some digging and found this out by checking the app, it's pretty good that they realized there was an issue. The core issue is that the method previously used for identifying if a meal was sold out, which was based on the meal title, is no longer valid. The implication here is that the application can't accurately report the current state of a meal's availability. The core issue is that the sold-out status is no longer embedded in the meal titles, as it once was. This makes it impossible for the app to know if a meal is sold out based on the title alone. Kiliankoe also shared an XML snippet from the RSS feed that is currently in use.
<item>
<title>
Alte Mensa - Pizza: Pizza Quattro formaggi mit Cheddar, Gouda, Hirtenkäse und Mozzarella (A, A1, G) (Studierende: 3,23 €, Bedienstete: 5,88 €)
</title>
<description>
<h1>Alte Mensa - Pizza</h1><p>Pizza Quattro formaggi mit Cheddar, Gouda, Hirtenkäse und Mozzarella (A, A1, G)</p><h2>Informationen</h2><ul><li>Menü ist vegetarisch</li><li>mit Farbstoff (1)</li><li>Glutenhaltiges Getreide (A)</li><li>Weizen (A1)</li><li>Milch/Milchzucker (Laktose) (G)</li></ul><h2>Preis(e)</h2><p>Studierende: 3,23 €, Bedienstete: 5,88 €</p><h2>Foto</h2><p><img src="https://static.studentenwerk-dresden.de/bilder/mensen/studentenwerk-dresden-lieber-mensen-gehen.jpg" alt="Foto des Angebots"></p>
</description>
<guid>
https://www.studentenwerk-dresden.de/mensen/speiseplan/details-324931.html
</guid>
<link>
https://www.studentenwerk-dresden.de/mensen/speiseplan/details-324931.html
</link>
<author>
webmaster@studentenwerk-dresden.de (Studentenwerk Dresden)
</author>
</item>
This XML shows the structure of the data the app receives. The title field no longer contains the sold-out status. The description field contains more detailed information. This means the app now needs to find another way to understand the status of a meal's availability. Kiliankoe provided a screenshot of the meal details page, which clearly shows the meal information. This highlights the issue that the application is currently experiencing.
Potential Solutions: How to Bring Back the Sold Out Status
Alright, so how do we fix this? Here are a few ideas, keeping in mind efficiency is key to avoiding slowing down the app and making it useless.
- Scraping the Detail Pages: This would mean the app would have to visit each meal's specific page to check its status. While this would give us the info we need, it could be slow and would put a lot of load on their servers, which could get the app blocked. Nobody wants that!
- Parsing the Description: The description in the XML feed could contain some clues. We'd need to parse the HTML within the
<description>tag to find the sold-out information. This might work if the information is consistently formatted, but could break if the website changes. This also has the potential of increasing the processing power required by the app, which might be an issue depending on the scale of the application's use. - Checking for specific tags: If there are tags for sold out, this could be the simplest method. The issue is that the provided XML does not contain any such tags, and would not work in this case.
- Contacting the Studentenwerk: Reaching out to the Studentenwerk Dresden to inquire about the availability information might be a viable option. Maybe there's a different feed or API that could provide this data more directly. This method is the simplest for the application, but depends on the responsiveness of the Studentenwerk.
These methods all come with their own set of pros and cons, each has varying degrees of complexity, and the effectiveness will depend on the source data. The main aim here is to balance accuracy and efficiency, since we don't want the app to be slow or unreliable.
The Impact of a Broken Sold Out Detection
Why does this matter so much? Well, the sold-out status is super important for users. Here's why:
- User Experience: Nobody wants to get their hopes up for a meal, only to find out it's gone. Showing the sold-out status improves the overall user experience and keeps everyone happy.
- Planning and Decision-Making: People use the app to plan their meals. Knowing what's available helps them decide what to eat and saves time.
- Efficiency: Without this feature, users might waste time going to a location only to find out their meal of choice isn't available.
So, bringing back the sold-out detection is not just a nice-to-have; it's a must-have for a good user experience.
Conclusion: Getting the MensaDD App Back on Track
So, where do we go from here? We need to find a new way to get the sold-out status. Kiliankoe is willing to open a PR (pull request) to fix this, which is awesome. The best approach will depend on the available data and how often the website changes. We should weigh the options carefully and prioritize a solution that's both accurate and efficient. Let's get this fixed so everyone can enjoy their meals without any sold-out surprises!
Strong consideration should be given to the efficiency of the methods for the application. The application should attempt to identify the status of a meal in a timely and accurate fashion. The user experience is important.
In summary: The 'sold out' detection feature in the MensaDD app is broken because the information is no longer in the meal titles. Several solutions exist, including scraping detail pages, parsing descriptions, and contacting the Studentenwerk. Restoring this functionality is crucial for a positive user experience. The app needs to ensure that users know the status of meals, ensuring a great experience. By making the app more reliable, users are more likely to use the app, and enjoy the benefits of using the app.