mealpy icon indicating copy to clipboard operation
mealpy copied to clipboard

List restaurants, meals, and hours from cli

Open ipwnponies opened this issue 6 years ago • 4 comments

We can cache the response of the restaurant/meal/hours queries. This will provide users ability to lookup possible inputs to provide as arguments.

Meals might be trickier, since they can change day-to-day. That can be a follow-up to this ticket, the benefit of getting reasonable inputs to provide to CLI arguments is great enough on its own.

ipwnponies avatar Mar 20 '19 17:03 ipwnponies

To add on to the caching of meals, here are some relevant thoughts:

  • From my experience, most restaurants have a fixed rotation of menus per week, so it might make sense to simply cache each restaurant’s item for a particular day, and possibly invalidate an outdated menu item if detected to be “incorrect”.
  • Having a “preference” ranking instead of a single menu item, which can help with the possibility that a certain menu item that was chosen is unavailable for some reason, and allows the script to fallback to another option.

edmundmok avatar Mar 20 '19 23:03 edmundmok

By the way, it seems like I can still access the API with an account that is no longer subscribed (though I probably can't order anything), so I can try to help out with some of these issues.

edmundmok avatar Mar 21 '19 00:03 edmundmok

For v1, we can simply be naive and cache the last meal. For v2, we can cache meals per day of week.

Preference ranking with fallback behaviour is a great feature and enough work to warrant its own ticket (#9)

ipwnponies avatar Mar 21 '19 03:03 ipwnponies

By the way, it seems like I can still access the API with an account that is no longer subscribed (though I probably can't order anything), so I can try to help out with some of these issues.

lol today was actually my last meal on the plan (putting it on hold for the next several weeks). So I was frantically dumping all the response for analyzing later. It's good to know that I can still use the api.

ipwnponies avatar Mar 21 '19 03:03 ipwnponies