kacpi2442 / am_bot

Using the toogoodtogo and foodsi APIs to notify me via a Telegram bot for open offers
39 stars 19 forks source link

Filter favourites from foodsi #8

Closed NickXDD closed 1 year ago

NickXDD commented 1 year ago

Hi! Firstly, you are making a good job and I appreciate it! I would love to see the option to filter favourites from foodsi, as you can do with too good to go.

Cheers

kacpi2442 commented 1 year ago

AFAIK there is parameter in Foodsi API for this, but i haven't tried using it. Try adding this to the request JSON, and let me know if this works for you: "user_favourites": True

NickXDD commented 1 year ago

Added in line 276 (incl. recent update) and for me it doesn't work sadly, there are notifications for all of the goodie bags as usual.

kacpi2442 commented 1 year ago

It's not possible without providing account credentials to the bot. It would be needed to reverse engineer Foodsi authorization API.

NickXDD commented 1 year ago

Hello again, thinking about the issue I figured out that maybe it would be possible to filter goodies from foodsi by type as you can do in the app? So the bot would send notifications when there's a goodie available for ex. only from restaurants, not shops. That certainly would reduce the amount of spam notifications from foodsi.

wrobelda commented 1 year ago

I'd suggest that instead reverse-engineering the app only to grap a list of favorites, you could add a command line switch to list all the restaurants by their name and ID within the configured geo proximity, and then check them by the IDs, as provided by user in their config file.