marklagendijk / node-toogoodtogo-watcher Goto Github PK
View Code? Open in Web Editor NEWNode.js cli tool for monitoring your favorite TooGoodToGo businesses. Docker image available.
License: MIT License
Node.js cli tool for monitoring your favorite TooGoodToGo businesses. Docker image available.
License: MIT License
I'm having issues getting this to run on a docker container on my Synology NAS.
Anyone who can help me out getting this to work?
Hi and thanks for your work!
I´ve following error:
Login seems to happen, because I got the new device email then this happens continuely
Error 404 during POST https://apptoogoodtogo.com/api/item/v3/:
undefined
Any suggestions? :/
Thanks in advance
I recently started getting 404 error messages in the log. Probably some kind of change in URL.
Error 404 during POST https://apptoogoodtogo.com/api/item/v3
I encountered issues when trying to run node index.js watch
on the container pulled from docker hub on Heroku. I tagged the image pulled from the repo and tagged it according to the Heroku tutorial.
~ $ node index.js watch
undefined:1
{api:{credentials:{email:[email protected],password:rly-good-password},session:{},headers:{User-Agent:TooGoodToGo/20.6.1 (813) (iPhone/iPhone 7 (GSM); iOS 13.6; Scale/2.00)},pollingIntervalInMs:30000,authenticationIntervalInMS:3600000},notifications:{console:{enabled:false,clear:true},desktop:{enabled:false},telegram:{enabled:true,botToken:some-amazing-token,chats:[]},ifttt:{enabled:false,webhookKey:see README,webhookEvents:[see README]},gotify:{enabled:false,url:http://push.example.com,apptoken:token,priority:5}},messageFilter:{showUnchanged:false,showDecrease:false,showDecreaseToZero:false,showIncrease:false,showIncreaseFromZero:true}}
^
SyntaxError: Unexpected token a in JSON at position 1
at JSON.parse (<anonymous>)
at Object.<anonymous> (/app/index.js:36:33)
at Module._compile (internal/modules/cjs/loader.js:1072:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
at Module.load (internal/modules/cjs/loader.js:937:32)
at Function.Module._load (internal/modules/cjs/loader.js:778:12)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
at internal/main/run_main_module.js:17:47
I am not sure running dockerized node app on Heroku is the best option. But I tried to launch a worker using Procfile on Heroku directly also failed. Could you provide more detailed instructions on deploying on Heroku if possible?
Hi,
I'm trying to run multiple instances of the tool on one device as advised in issue 21.
Since I am quite inexperienced with node.js and such things, I'd like to ask how I can best do this?
My main problem is that both instances access the same config-file and crash.
I really appreciate your help.
Anybody else is experiencing this issue?
`Error during request:
POST https://apptoogoodtogo.com/api/auth/v1/token/refresh
{
"refresh_token": "UkVGUkVTSDoxNjI3NzI0OTpaSEh6aklOS1hNd*********Wk5PN0t6M0VSWGo="
}
HTTPError: Response code 401 (Unauthorized)
at Request. (C:\Users\HOME\AppData\Roaming\npm\node_modules\toogoodtogo-watcher\node_modules\got\dist\source\as-promise\index.js:117:42)
at processTicksAndRejections (internal/process/task_queues.js:93:5)`
Hi,
Nice work !
I do not use Telegram and would like to run this selfhosted (without a terminal) and I am on Slack for work all day. Do you think adding a slack notification would be possible ?
Thanks a lot,
Tom
Currently, apptoogoodtogo.com
is resolved via DNS on every request. This should be cached.
This seems to be easily achievable by configuring got
's dnsCache
setting. See https://www.npmjs.com/package/got#dnscache
I've follow the docker-compose instructions and my config file always gets overridden resulting in the following logs:
Error during request:,
POST https://apptoogoodtogo.com/api/auth/v1/loginByEmail,
{,
"device_type": "UNKNOWN",,
"email": "Email of your TooGoodToGo account.",,
"password": "Password of your TooGoodToGo account.",
},
,
HTTPError: Response code 403 (Forbidden),
at onResponse (/home/node/app/node_modules/got/dist/source/as-promise/index.js:142:28),
at processTicksAndRejections (internal/process/task_queues.js:95:5),
I plan to try and implement something like this for my own usage, but wanted to throw out the idea, incase it's already there or could be done in a better way. Essential issue is, telegram bot is based on our favorites, but maybe you want it to shut up for a while unless the few things your currently interested in appears (time for bread.. or certain restaurant etc). Rather than manually removing favs – could just filter the telegram bot to only report if certain words are found. Like:
/filter_set xxxxx xxxxxx xxxxxx
(list of general words in name of listing, with a space/comma after it
/filter_get
(lists filters currently used)
/filter_clear
(clears the list - maybe not needed, as one could just override with set or turn off)
/filter_on
(activates filter, automatically done with /filter_set
/filter_off
(disables filter, but leaves list alone)
Or much simpler, if the bot could offer an interactive checkbox (poll?) for your favs to just toggle on/off for notification? If possible, would just need one command like /filter
Hey, I hope there is an easy solution, I think The App banned the IP or the Agent and cant refresh the token anymore.
Tried to change my passwort and will try another Account now, but maybe something to be considered.
EDIT: Tried another Account, same Error.
EDIT: Reset Settings now it works again^^
Worked quite well for a while but now after 2 weeeks it stopped working.
Hi there,
i got the following error:
HTTPError: Response code 401 (Unauthorized)
at onResponse (/home/node/app/node_modules/got/dist/source/as-promise/index.js:142:28)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
Error during request:
POST https://apptoogoodtogo.com/api/item/v7/
A refresh of the session does not helped, the error is still there.
Any ideas how to fix it?
I'm trying to run this with docker on my synology nas.
I'm getting these errors, and I do not know what to do. I have set the correct path to config folder. I'm also getting a login email from TGTG that someone logged in on different machine, so the config works.
I've set the telegram notifications, but I'm not receiving the initial "greet" with favorites.
`
2021-01-13 09:05:48 | stdout | at process._tickCallback (internal/process/next_tick.js:68:7) |
---|---|---|
2021-01-13 09:05:48 | stdout | at createSession (/home/node/app/lib/api.js:76:10) |
2021-01-13 09:05:48 | stdout | at Conf.set (/home/node/app/node_modules/conf/dist/source/index.js:182:20) |
2021-01-13 09:05:48 | stdout | at Conf.set store [as store] (/home/node/app/node_modules/conf/dist/source/index.js:282:14) |
2021-01-13 09:05:48 | stdout | at Conf._write (/home/node/app/node_modules/conf/dist/source/index.js:368:28) |
2021-01-13 09:05:48 | stdout | at Object.writeFileSync (/home/node/app/node_modules/atomically/dist/index.js:136:49) |
2021-01-13 09:05:48 | stdout | at attempt (/home/node/app/node_modules/atomically/dist/utils/retryify.js:26:27) |
2021-01-13 09:05:48 | stdout | at openSync (fs.js:443:3) |
2021-01-13 09:05:48 | stdout | Error: EACCES: permission denied, open '/home/node/.config/toogoodtogo-watcher-nodejs/config.json.tmp-0528748000def7bf' |
2021-01-13 09:05:47 | stdout | �[32m'/home/node/.config/toogoodtogo-watcher-nodejs/config.json.tmp-0528747644b6ed08'�[39m } |
2021-01-13 09:05:47 | stdout | path: |
2021-01-13 09:05:47 | stdout | code: �[32m'EACCES'�[39m, |
2021-01-13 09:05:47 | stdout | syscall: �[32m'open'�[39m, |
2021-01-13 09:05:47 | stdout | errno: �[33m-13�[39m, |
2021-01-13 09:05:47 | stdout | at process._tickCallback (internal/process/next_tick.js:68:7) |
2021-01-13 09:05:47 | stdout | at Promise.resolve.then (/home/node/app/node_modules/telegraf/composer.js:143:56) |
2021-01-13 09:05:47 | stdout | at startCommand (/home/node/app/lib/telegram-bot.js:53:3) |
2021-01-13 09:05:47 | stdout | at addChat (/home/node/app/lib/telegram-bot.js:78:10) |
2021-01-13 09:05:47 | stdout | at Conf.set (/home/node/app/node_modules/conf/dist/source/index.js:182:20) |
2021-01-13 09:05:47 | stdout | at Conf.set store [as store] (/home/node/app/node_modules/conf/dist/source/index.js:282:14) |
2021-01-13 09:05:47 | stdout | at Conf._write (/home/node/app/node_modules/conf/dist/source/index.js:368:28) |
2021-01-13 09:05:47 | stdout | at Object.writeFileSync (/home/node/app/node_modules/atomically/dist/index.js:136:49) |
2021-01-13 09:05:47 | stdout | at attempt (/home/node/app/node_modules/atomically/dist/utils/retryify.js:26:27) |
2021-01-13 09:05:47 | stdout | at openSync (fs.js:443:3) |
2021-01-13 09:05:47 | stdout | Failed to process updates. { Error: EACCES: permission denied, open '/home/node/.config/toogoodtogo-watcher-nodejs/config.json.tmp-0528747644b6ed08' |
2021-01-13 09:05:47 | stdout | |
2021-01-13 09:05:47 | stdout | at process._tickCallback (internal/process/next_tick.js:68:7) |
2021-01-13 09:05:47 | stdout | at Promise.resolve.then (/home/node/app/node_modules/telegraf/composer.js:143:56) |
2021-01-13 09:05:47 | stdout | at startCommand (/home/node/app/lib/telegram-bot.js:53:3) |
2021-01-13 09:05:47 | stdout | at addChat (/home/node/app/lib/telegram-bot.js:78:10) |
2021-01-13 09:05:47 | stdout | at Conf.set (/home/node/app/node_modules/conf/dist/source/index.js:182:20) |
2021-01-13 09:05:47 | stdout | at Conf.set store [as store] (/home/node/app/node_modules/conf/dist/source/index.js:282:14) |
2021-01-13 09:05:47 | stdout | at Conf._write (/home/node/app/node_modules/conf/dist/source/index.js:368:28) |
2021-01-13 09:05:47 | stdout | at Object.writeFileSync (/home/node/app/node_modules/atomically/dist/index.js:136:49) |
2021-01-13 09:05:47 | stdout | at attempt (/home/node/app/node_modules/atomically/dist/utils/retryify.js:26:27) |
2021-01-13 09:05:47 | stdout | at openSync (fs.js:443:3) |
2021-01-13 09:05:47 | stdout | Error: EACCES: permission denied, open '/home/node/.config/toogoodtogo-watcher-nodejs/config.json.tmp-0528747644b6ed08' |
` |
Hello
I've install the docker in my ContainerStation in Qnap.
Like this:
https://hub.docker.com/r/marklagendijk/toogoodtogo-watcher#docker
docker create \
--name toogoodtogoWatcher \
-v /myPathToConfigFile:/home/node/.config/toogoodtogo-watcher-nodejs \
marklagendijk/toogoodtogo-watcher
I can create and run my docker and I recive an email from TooGoodToGo with new login.
But I recive this result in docker console:
Error during request:
POST https://apptoogoodtogo.com/api/auth/v1/loginByEmail
{
"device_type": "UNKNOWN",
"email": "Email of your TooGoodToGo account.",
"password": "Password of your TooGoodToGo account."
}
HTTPError: Response code 403 (Forbidden)
at onResponse (/home/node/app/node_modules/got/dist/source/as-promise/index.js:142:28)
at process._tickCallback (internal/process/next_tick.js:68:7)
Error during request:
POST https://apptoogoodtogo.com/api/auth/v1/loginByEmail
{
"device_type": "UNKNOWN",
"email": "Email of your TooGoodToGo account.",
"password": "Password of your TooGoodToGo account."
}
HTTPError: Response code 403 (Forbidden)
at onResponse (/home/node/app/node_modules/got/dist/source/as-promise/index.js:142:28)
at process._tickCallback (internal/process/next_tick.js:68:7)
So I don't recive Telegrams with new available stores. If I run the the same config.file in my MAC, I recive Telegram's messages with new Stores.
{
"api": {
"credentials": {
"email": "myMail",
"password": "myPassword"
},
"session": {},
"headers": {
"User-Agent": "TooGoodToGo/20.6.1 (813) (iPhone/iPhone 7 (GSM); iOS 13.6; Scale/2.00)"
},
"pollingIntervalInMs": 30000,
"authenticationIntervalInMS": 3600000
},
"notifications": {
"console": {
"enabled": false,
"clear": true
},
"desktop": {
"enabled": false
},
"telegram": {
"enabled": true,
"botToken": "myTelegramToken",
"chats": []
}
},
"messageFilter": {
"showUnchanged": false,
"showDecrease": false,
"showDecreaseToZero": false,
"showIncrease": false,
"showIncreaseFromZero": true
}
}
What I'm doing wrong?
Thanks
Hi,
if this is inappropriate, please delete it.
Thanks for the excellent product and helpful setup guidelines.
I have a question (or rather a feature idea) about automatic reservation of one (1) magic box in favorites.
My issue is even I'm using watcher with short refresh time - I always late to book magic box from one particular supplier in particular timeframe.
Most probably someone is using automatic reservation (example here: https://tgtg-alerts.com/en/auto, and there are other similar services). I'm always late for several seconds. Obviously, it is not a magic box of interest anymore, it is rather a "competition" to outsmart this person and make the reservation first (even I'm not going to buy it, and will let him/her to purchase it later).
Hi,
i'm using your script on Windows 10, latest Node, sending notification trough Telegram. I'm often getting this message:
"HTTPError: Response code 504 (Gateway Time-out)
at Request. (C:\Users\Marco\AppData\Roaming\npm\node_modules\toogoodtogo-watcher\node_modules\got\dist\source\as-promise\index.js:117:42)
at runMicrotasks ()
at processTicksAndRejections (node:internal/process/task_queues:96:5)"
Hello everybody, I was very happy for 2 weeks to use this script but since two days or so ago I get this message when I try to start the app:
C:\Users\B>toogoodtogo-watcher watch
Error during request:
POST https://apptoogoodtogo.com/api/auth/v1/loginByEmail
{
"device_type": "UNKNOWN",
"email": "********@gmail.com",
"password": "*******"
}
HTTPError: Response code 403 (Forbidden)
at onResponse (C:\Users\B\AppData\Roaming\npm\node_modules\toogoodtogo-watcher\node_modules\got\dist\source\as-promise\index.js:142:28)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
At first I thought it was the telegram bot as I got a message refresh token, which I created a completely new bot and started a new config file but I can not get the connection from my computer. Have they blocked it somehow? Any help would be appreciated, I am new to coding. Thank you in advance.
First of all, thanks for the great work!
Due to a configuration error, the program initially did not have write permissions to its config directory. In this case the error message is rather unhelpful:
Error undefined during undefined undefinedundefined:
undefined
There is a New version in the API or Auth ?
Error during request:POST https://apptoogoodtogo.com/api/auth/v1/token/refresh
I'm getting following error after a short time:
pi@raspberrypi:~ $ toogoodtogo-watcher watch
Error during request:
POST https://apptoogoodtogo.com/api/auth/v1/token/refresh
{
"refresh_token": "removed by me"
}
RequestError: getaddrinfo ENOTFOUND apptoogoodtogo.com
at ClientRequest.<anonymous> (/usr/lib/node_modules/toogoodtogo-watcher/node_modules/got/dist/source/core/index.js:953:111)
at Object.onceWrapper (node:events:434:26)
at ClientRequest.emit (node:events:339:22)
at ClientRequest.origin.emit (/usr/lib/node_modules/toogoodtogo-watcher/node_modules/@szmarczak/http-timer/dist/source/index.js:39:20)
at TLSSocket.socketErrorListener (node:_http_client:478:9)
at TLSSocket.emit (node:events:327:20)
at emitErrorNT (node:internal/streams/destroy:194:8)
at emitErrorCloseNT (node:internal/streams/destroy:159:3)
at processTicksAndRejections (node:internal/process/task_queues:80:21)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:67:26)
Edit:
Now it works again, though I didn't change anything.
Tried to get running on an RPi and get the following error when using the config
command:
Saved config at: /home/pi/.config/toogoodtogo-watcher-nodejs/config.json
events.js:174
throw er; // Unhandled 'error' event
^
Error: spawn vim ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)
at onErrorNT (internal/child_process.js:415:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
at Function.Module.runMain (internal/modules/cjs/loader.js:834:11)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)
Emitted 'error' event at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:246:12)
at onErrorNT (internal/child_process.js:415:16)
[... lines matching original stack trace ...]
at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)
Any idea what the problem might be?
I did have to install using sudo
with npm, as there was an error without.
Nevertheless, could set the config file manually with nano
on that path and seems to work.. got the telegram bot setup etc...
Lastly, any advice/experience on setting this up with pm2? Tried to add the 'watch' command to the start but seemed to fail...
Hi all.
I'm getting this new error.
Maybe they changed something on the API or website?
HTTPError: Response code 404 (Not Found)
at onResponse (/home/node/app/node_modules/got/dist/source/as-promise/index.js:142:28)
at process._tickCallback (internal/process/next_tick.js:68:7)
First of all I would like to thank you for the great work!
I have a pi.hole and I noticed that the script is making a lot of requests to apptoogoodtogo.com. Every 30 seconds, day and night. I am aware that I can change this in the config. I only use the telegram bot integration, is it possible there if I stop the bot with /stop, that it stops sending requests to apptoogoodtogo.com. In the cli I see my instance of the telegram chat. I would like to do this myself but unfortunately I don't understand JavaScript enough.
It would also reduce the load on the server and prevent tgtg from changing the API again. Due to unintended use of the tgtg API.
Hello,
Sorry, but I am not familiar with Linux.
I want to automatically launch the command: "toogoodtogo-watcher watch" when launching my Raspberry.
Can you help me find the order?
thanks in advance.
Hi, I love your app :)
I am using it from your website for now, and am trying to switch to the Docker image to lift the 5 shops restriction, but I'm getting stuck.
How do I do any toogoodtogo-watcher
commands in a docker container ?
I don't know if it's running properly because the logs are empty.
Example of what I tried
$ docker exec toogoodtogo-watcher sh -c 'toogoodtogo-watcher --help'
sh: toogoodtogo-watcher: not found
Error during request:
POST https://apptoogoodtogo.com/api/auth/v1/loginByEmail
{
"device_type": "UNKNOWN"
}
HTTPError: Response code 400 (Bad Request)
at Request.<anonymous> (C:\Users\Yellowek\Desktop\node-v16.11.0-win-x64\node_modules\toogoodtogo-watcher\node_modules\got\dist\source\as-promise\index.js:117:42)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
Tried this today, it was my first time and this happens ^
tried solutions from previous issue but same results as above
Hi,
Some stores last seconds available. I don't know the details of how implementing purchasing within the bot would be. Does anyone have any pointers? I could look into it but not sure where to start.
The response in JSON file shows page_no: 2, limit: 20 outside info.
I don't know how to see others pages.
After installation if I run "toogotogo-watcher config" I can set properly my credentials, but after I run "toogotogo-watcher watch" I see this error: RequestError: self signed certificate in certificate chain.
I tried "npm set strict-ssl false" without success.
Im running on an us server. the time seems to be off by 2 hours earlier when ran from heroku then local. ive changed the coordinates in the api.js to rotterdam without luck.
Hi,
i got the following error:
EACCES: permission denied, open '/home/node/.config/toogoodtogo-watcher-nodejs/config.json.tmp-5366961130cd3aab'
This error occurred as soon as the container was started.
Whether the volue is a docker volume or a directory
Thanks
Hi, this is my first time trying to run script like this. Im getting the message below in console and I don't know what to do about it :)
C:\Windows\system32>toogoodtogo-watcher watch
Added chat Maciej undefined (1262809328)
400 - Bad Request: message text is empty
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.
Hi,
I've just set up toogoodtogo-watcher
The notifications in the console are working great but when I try to set up Telegram notification, nothing happen.
I'm used to Telegram bot with token creation but this time nothing, no error messages in toogoodtogo, no nothing.
Did I missed something ?
{
"api": {
"credentials": {
"email": "******************",
"password": "******************"
},
"session": {
"userId": "940629",
"accessToken": "********************************",
"refreshToken": "*******************************"
},
"headers": {
"User-Agent": "TooGoodToGo/20.6.1 (813) (iPhone/iPhone 7 (GSM); iOS 13.6; Scale/2.00)"
},
"pollingIntervalInMs": 30000,
"authenticationIntervalInMS": 3600000
},
"notifications": {
"console": {
"enabled": false,
"clear": true
},
"desktop": {
"enabled": false
},
"telegram": {
"enabled": true,
"botToken": "********************************",
"chats": []
},
"ifttt": {
"enabled": false,
"webhookKey": "see README",
"webhookEvents": [
"see README"
]
}
},
"messageFilter": {
"showUnchanged": false,
"showDecrease": false,
"showDecreaseToZero": false,
"showIncrease": true,
"showIncreaseFromZero": true
}
}
Is there something related to the chats
array in Telegram ?
Hi,
when I use toogoodtogo-watcher and a new food appears, I get a notification on Telegram, but this error appears immediately and the program crashes.
`node:internal/process/promises:246
triggerUncaughtException(err, true /* fromPromise */);
^
HTTPError: Response code 404 (Not Found)
at Request. (/usr/lib/node_modules/toogoodtogo-watcher/node_modules/got/dist/source/as-promise/index.js:117:42)
at processTicksAndRejections (node:internal/process/task_queues:96:5) {
code: undefined,
timings: {
start: 1625159720926,
socket: 1625159720927,
lookup: 1625159720979,
connect: 1625159721082,
secureConnect: 1625159721288,
upload: 1625159721288,
response: 1625159721393,
end: 1625159721393,
error: undefined,
abort: undefined,
phases: {
wait: 1,
dns: 52,
tcp: 103,
tls: 206,
request: 0,
firstByte: 105,
download: 0,
total: 467
}
}
}`
Hello, thank you very much for your work,
I am trying the DOCKER installation of your development. When launching the following instruction:
docker run --name toogoodtogo-watcher -v / home / pi / config marklagendijk / toogoodtogo-watcher
It throws me the following error:
pi @ raspberrypi: ~ $ sudo docker run --name toogoodtogo-watcher -v / home / pi / config marklagendijk / toogoodtogo-watcher
Unable to find image 'marklagendijk / toogoodtogo-watcher: latest' locally
latest: Pulling from marklagendijk / toogoodtogo-watcher
cbdbe7a5bc2a: Pull complete
338e24a1fcf8: Pull complete
68c2b1f63a50: Pull complete
70840f95d8e3: Pull complete
e33910ba3fe4: Pull complete
e39d46dd4076: Pull complete
734716a8bbf9: Pull complete
a35067829acc: Pull complete
663686d91520: Pull complete
Digest: sha256: 789fcf20ba519b9f467a4c43579b42db8fde2d934525311ba91a77f89cece5ef
Status: Downloaded newer image for marklagendijk / toogoodtogo-watcher: latest
standard_init_linux.go: 211: exec user process caused "exec format error"
I don't understand the reason for the error, can you help me?
Greetings and thanks,
Alex
Stopped working today.
Console output below, just changed the user email and user password.
I've tried to clean session data in config file - it did not help.
===
Error during request:
POST https://apptoogoodtogo.com/api/auth/v1/loginByEmail
{
"device_type": "UNKNOWN",
"email": "user_email",
"password": "user_pass"
}
HTTPError: Response code 403 (Forbidden)
at Request. (C:\Users\Slava\AppData\Roaming\npm\node_modules\toogoodtogo-watcher\node_modules\got\dist\source\as-promise\index.js:117:42)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
Hi !
I appreciate your work 👍
Would love to implement multi-users on one Telegram bot.
I tried to observe the changes when addChat() is called, then subscribe to pollBusinesses() for a specific user id.
Same for removeChat(), I would unsubscribe the pollBusinesses() for a specific user id.
Do you have any idea to manage the subscriptions easily ?
Thanks =)
2021-03-27T18:51:47.412662+00:00 app[worker.1]: /app/.heroku/node/lib/node_modules/toogoodtogo-watcher/node_modules/rxjs/internal/util/hostReportError.js:4
2021-03-27T18:51:47.412663+00:00 app[worker.1]: setTimeout(function () { throw err; }, 0);
TypeError: Cannot read property 'telegram' of null
2021-03-27T18:51:47.412665+00:00 app[worker.1]: at sendMessage (/app/.heroku/node/lib/node_modules/toogoodtogo-watcher/lib/telegram-bot.js:65:14)
2021-03-27T18:51:47.412665+00:00 app[worker.1]: at /app/.heroku/node/lib/node_modules/toogoodtogo-watcher/lib/telegram-bot.js:61:30
2021-03-27T18:51:47.412666+00:00 app[worker.1]: at arrayEach (/app/.heroku/node/lib/node_modules/toogoodtogo-watcher/node_modules/lodash/lodash.js:530:11)
2021-03-27T18:51:47.412666+00:00 app[worker.1]: at Function.forEach (/app/.heroku/node/lib/node_modules/toogoodtogo-watcher/node_modules/lodash/lodash.js:9410:14)
2021-03-27T18:51:47.412667+00:00 app[worker.1]: at Object.notify (/app/.heroku/node/lib/node_modules/toogoodtogo-watcher/lib/telegram-bot.js:61:5)
2021-03-27T18:51:47.412667+00:00 app[worker.1]: at Object.notifyIfChanged (/app/.heroku/node/lib/node_modules/toogoodtogo-watcher/lib/notifier.js:41:19)
2021-03-27T18:51:47.412667+00:00 app[worker.1]: at SafeSubscriber._next (/app/.heroku/node/lib/node_modules/toogoodtogo-watcher/index.js:41:32)
2021-03-27T18:51:47.412668+00:00 app[worker.1]: at SafeSubscriber.__tryOrUnsub (/app/.heroku/node/lib/node_modules/toogoodtogo-watcher/node_modules/rxjs/internal/Subscriber.js:205:16)
2021-03-27T18:51:47.412669+00:00 app[worker.1]: at SafeSubscriber.next (/app/.heroku/node/lib/node_modules/toogoodtogo-watcher/node_modules/rxjs/internal/Subscriber.js:143:22)
2021-03-27T18:51:47.412669+00:00 app[worker.1]: at Subscriber._next (/app/.heroku/node/lib/node_modules/toogoodtogo-watcher/node_modules/rxjs/internal/Subscriber.js:89:26)
Error. App updated - "Please update your app - 0"
The notifications arriving by telegram have been one hour ahead of actual pickup times in app.
Maybe day light savings is being ignored while formating times?
I getting, "out of nowhere", this error;
Error 403 during POST https://apptoogoodtogo.com/api/auth/v1/loginByEmail:
[
{
"code": "FAILED_LOGIN"
}
]
Any idea whats happening or how to sove?
This my postman NodeJS Request code;
var request = require('request');
var options = {
'method': 'POST',
'url': 'https://apptoogoodtogo.com/api/auth/v1/loginByEmail',
'headers': {
'User-Agent': 'TGTG/19.12.0 (724) (Android/Unknown; Scale/3.00)',
'Content-Type': 'application/json',
'Accept': 'application/json',
'Accept-Language': 'en-US'
},
body: JSON.stringify({"device_type":"UNKNOWN","email":"[email protected]","password":"xxxxx"})
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
Above code returns a full response from the API and with the same credentials my docker container fails.
Hi,
just noticed that they have updated the API once more so that just like here
you need to update the the value from v5 to v6.
Just did that and it worked again. Just in case you're getting the 404 error.
Hi,
I just got this issue at the time an event was triggered:
/usr/local/lib/node_modules/toogoodtogo-watcher/node_modules/rxjs/internal/util/hostReportError.js:4
setTimeout(function () { throw err; }, 0);
^
TypeError: iftttEvents is not iterable
at notifyIFTTT (/usr/local/lib/node_modules/toogoodtogo-watcher/lib/ifttt.js:14:28)
at Object.notifyIfChanged (/usr/local/lib/node_modules/toogoodtogo-watcher/lib/notifier.js:44:7)
at SafeSubscriber.pollFavoriteBusinesses$.subscribe [as _next] (/usr/local/lib/node_modules/toogoodtogo-watcher/index.js:41:32)
at SafeSubscriber.__tryOrUnsub (/usr/local/lib/node_modules/toogoodtogo-watcher/node_modules/rxjs/internal/Subscriber.js:205:16)
at SafeSubscriber.next (/usr/local/lib/node_modules/toogoodtogo-watcher/node_modules/rxjs/internal/Subscriber.js:143:22)
at Subscriber._next (/usr/local/lib/node_modules/toogoodtogo-watcher/node_modules/rxjs/internal/Subscriber.js:89:26)
at Subscriber.next (/usr/local/lib/node_modules/toogoodtogo-watcher/node_modules/rxjs/internal/Subscriber.js:66:18)
at MergeMapSubscriber.notifyNext (/usr/local/lib/node_modules/toogoodtogo-watcher/node_modules/rxjs/internal/operators/mergeMap.js:93:26)
at SimpleInnerSubscriber._next (/usr/local/lib/node_modules/toogoodtogo-watcher/node_modules/rxjs/internal/innerSubscribe.js:27:21)
at SimpleInnerSubscriber.Subscriber.next (/usr/local/lib/node_modules/toogoodtogo-watcher/node_modules/rxjs/internal/Subscriber.js:66:18)
Regards,
How do you add a proxy-server to the config of connection ?
I have a proxy server, that also handle DNS, and the connection fails:
RequestError: getaddrinfo ENOTFOUND apptoogoodtogo.com
at ClientRequest. (C:\Users\xxxxxx\AppData\Roaming\npm\node_modules\toogoodtogo-watcher\node_modules\got\dist\source\core\index.js:953:111)
at Object.onceWrapper (events.js:297:20)
at ClientRequest.emit (events.js:214:15)
at ClientRequest.origin.emit (C:\Users\xxxxxx\AppData\Roaming\npm\node_modules\toogoodtogo-watcher\node_modules@szmarczak\http-timer\dist\source\index.js:39:20)
at TLSSocket.socketErrorListener (_http_client.js:406:9)
at TLSSocket.emit (events.js:209:13)
at emitErrorNT (internal/streams/destroy.js:91:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)
at processTicksAndRejections (internal/process/task_queues.js:77:11)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:60:26)
Anybody else is experiencing this issue?
Error during request:
POST https://apptoogoodtogo.com/api/item/v5/
{
"favorites_only": true,
"origin": {
"latitude": 52.5170365,
"longitude": 13.3888599
},
"radius": 200,
"user_id": "********"
}
HTTPError: Response code 404 (Not Found)
at Request.<anonymous> (C:\Users\****\AppData\Roaming\npm\node_modules\toogoodtogo-watcher\node_modules\got\dist\source\as-promise\index.js:117:42)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
Help! Please!
I am a beginner in Coding and tried to follow the instruction given in README.
But after I edited config.json
and tried toogoodtogo-watcher watch
,
it returned errors as below. And I noticed config.json was set defualt again.
I just followed the installation instruction step by step (1, 2, 3, but failed in 4). Could you please tell me how to fix this problem?
Thank you in advance.
{
"api": {
"credentials": {
"email": my email address,
"password": my password
},
"session": {},
"headers": {
"User-Agent": "TooGoodToGo/21.9.0 (813) (iPhone/iPhone 7 (GSM); iOS 15.1; Scale/2.00)"
},
"pollingIntervalInMs": 30000,
"authenticationIntervalInMS": 3600000
},
"notifications": {
"console": {
"enabled": false,
"clear": true
},
"desktop": {
"enabled": false
},
"telegram": {
"enabled": true,
"botToken": mytelegrambotToken,
"chats": []
},
"ifttt": {
"enabled": false,
"webhookKey": "see README",
"webhookEvents": [
"see README"
]
},
"gotify": {
"enabled": false,
"url": "http://push.example.com",
"apptoken": "token",
"priority": 5
}
},
"messageFilter": {
"showUnchanged": false,
"showDecrease": false,
"showDecreaseToZero": false,
"showIncrease": false,
"showIncreaseFromZero": true
}
}
Error during request:
POST https://apptoogoodtogo.com/api/auth/v1/loginByEmail
{
"device_type": "UNKNOWN",
"email": "Email of your TooGoodToGo account.",
"password": "Password of your TooGoodToGo account."
}
HTTPError: Response code 403 (Forbidden)
at Request. (/usr/lib/node_modules/toogoodtogo-watcher/node_modules/got/dist/source/as-promise/index.js:117:42)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
Hi,
this is an awesome app especially with the telegram messages!! 👍
Unfortunately with NodeJS I get the response
Launch failed
Error: 401: Unauthorized
at C:\Users\erich\node_modules\telegraf\core\network\client.js:281:17
at processTicksAndRejections (node:internal/process/task_queues:93:5)
Anyone seen this before?
Credentials are fine, since I get the new log in mail by TGTG.
User agent is correct as well as the API v5 for listFavoriteBusinesses()
Any ideas?
Thx in advance
Hello,
Toogoodtogo is down this morning. It could be great to manage these errors instead of stopping the service.
'<html>\r\n<head><title>502 Bad Gateway</title></head>\r\n<body bgcolor="white">\r\n<center><h1>502 Bad Gateway</h1></center>\r\n</body>\r\n</html>\r\n'
(or getting a notification in case of errors)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.