marklagendijk/node-toogoodtogo-watcher

Feature request: Telegram message with url to open app

bokkoman opened this issue ยท 12 comments

Thank for this simple yet very helpful little programming.
I was wondering if it was possible to add a clickable link to open the app directly on your phone from telegram?
I know it sounds lazy, but still, very helpful because you can click on it from the top notification.

Like "link.toogoodtogo.com" or "share.toogoodtogo.com". These are the ones I can find in the android settings.

I've implemented this in my fork if you'd like to check it out here

@alice17 so you can link directly to the matching business inside the TGTG app, that's really nice!
Applying this properly requires some refactoring, because not all notification types support HTML.

I've implemented this in my fork if you'd like to check it out here

Sounds great @alice17, how can i run this in my docker environment?
I'm not an expert on this, i usually grab it from the official docker community (through my synology nas interface).

@alice17 so you can link directly to the matching business inside the TGTG app, that's really nice!
Applying this properly requires some refactoring, because not all notification types support HTML.

@marklagendijk The html feature works only with Telegram messages.

@bokkoman The modified functions are formatMessage and sendMessage. Maybe I can open a merge request and merge it here directly.

@alice17 @marklagendijk that merge would be great!

Maybe just request it and see what mark has to say about it.

I'm curious, did you have any other (small) improvements?

I'm always open to improvements.

Only limitations are:

  • Code quality
  • No sneaky / aggressive things towards TooGoodToGo. For example, no evasion techniques and no automatic buying.
  • Should be worth the extra complexity / documentation.
  • My time for this project is usually limited

@marklagendijk @bokkoman I've just created a new branch in my repo with the html feature. I've just checked the code and Mark is right, right now the formatted message is used also in other services while it should only work for Telegram (for now).
I will keep working on it in order to open the pull request.

I'm curious, did you have any other (small) improvements?

More console logging, Heroku integration and I added a /ping function in order to check if the bot is running. I'm also trying to implement a /favourite command in order to list all my favourite business but it doesn't work. :P

Yeah like @andreaseide80 said. It does not have to be a complicated html message, just add a link to the text message. The app usually changes that to a clickable link. And if you click that link, it will open the app.

So something like this:
Store name - ## of boxes available https://link.toogoodtogo.com

@bokkoman Yeah, it shows you the title with the clickable link, the number of boxes and the withdrawal time.
Anyway, I've just opened the pull request :)

@alice17 i see it. Looks a lot cleaner than plain text ๐Ÿ˜€

@marklagendijk hope you can pull this request to your master branch.

I just released this. Thanks @alice17 for doing the research and implementation!
I added documentation on how to set the timezone.