You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+68-54Lines changed: 68 additions & 54 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,63 +15,100 @@ This software is provided as is without warranty of any kind. If you have proble
15
15
16
16
## Disclaimer
17
17
18
-
Too Good To Go explicitly forbids the use of their platform the way this tool does. In their Terms and Conditions it says: "The Consumer must not misuse the Platform (including hacking or 'scraping')."
18
+
This Project is not affiliated, associated, authorized, endorsed by, or in any way officially connected with Too Good To Go, or any of its subsidiaries or its affiliates.
19
19
20
-
If you use this tool you do it at your own risk. TGTG may stop you from doing so by (temporarily) blocking your access and may even delete your account.
20
+
Too Good To Go explicitly forbids the usege of their platform the way this tool does if you use it. In their Terms and Conditions it says: "The Consumer must not misuse the Platform (including hacking or 'scraping')."
21
+
22
+
If you use this tool you do it at your own risk. Too Good To Go may stop you from doing so by (temporarily) blocking your access and may even delete your account.
21
23
22
24
## Error 403
23
25
24
26
If you see the Error 403 in your logs please refer to the [FAQ](https://github.com/Der-Henning/tgtg/wiki/FAQ#1-i-am-getting-error-403-all-the-time).
25
27
26
28
## Installation
27
29
28
-
You can install this tool on any computer. For 24/7 notifications I recommended to install the tool on a NAS like Synology or a Raspberry Pi. You can also use a virtual cloud server. Starting at 1,00 €/Month at Strato.de or try AWS free tier.
30
+
You can install this tool on any computer. For 24/7 notifications I recommended to an installation on a NAS like Synology or a Raspberry Pi. You can also try to use a virtual cloud server.
29
31
30
32
If you have any problems or questions feel free to create an issue.
31
33
34
+
For configuration options see [`config.sample.ini`](https://github.com/Der-Henning/tgtg/blob/main/src/config.sample.ini) or [`docker-compose.yml`](https://github.com/Der-Henning/tgtg/blob/main/docker-compose.yml).
35
+
32
36
You have the following three options to install the scanner, ascending in complexity:
33
37
34
38
### Use prebuild Release
35
39
36
40
This is the simplest but least flexible solution suitable for most operating systems.
37
41
42
+
The binaries are build for Linux, MacOS and Windows running on a `x64` architecture. If you are using an other architecture like `arm` (e.g. Raspberry Pi) you have to run from source, compile the binary yourself or use the docker images.
43
+
38
44
1. Download latest [Releases](https://github.com/Der-Henning/tgtg/releases) for your OS
39
45
2. Unzip the archive
40
-
3. Edit ```config.ini``` as described in the file
46
+
3. Edit `config.ini` as described in the file
41
47
4. Run scanner
42
48
43
-
You can run the scanner manually if you need it, add it to your system startup or create a service.
49
+
You can run the scanner manually if you need it, add it to your startup or create a system service.
44
50
45
51
The executables for Windows and MacOS are not signed by Microsoft and Apple, which would be very expensive.
46
52
On Mac you need to hold the control key while opening the file and on Windows you need to confirm the displayed dialog.
47
53
48
54
### Run with Docker
49
55
50
-
My preferred method for serversusing the pre build multi-arch linux images available on[Docker Hub](https://hub.docker.com/r/derhenning/tgtg).
56
+
My preferred method for servers, NAS and RapsberryPis is using the pre build multi-arch linux images available via[Docker Hub](https://hub.docker.com/r/derhenning/tgtg). The images are build for linux on `amd64`, `arm64`, `armv7`, `armv6` and `i386`.
51
57
52
58
1. Install Docker and docker-compose
53
-
2. Copy and edit ```docker-compose.yml``` as described in the file
54
-
3. Run ```docker-compose up -d```
59
+
2. Copy and edit `docker-compose.yml` as described in the file
60
+
3. Run `docker-compose up -d`
55
61
56
-
The container creates a volume mounting ```\tokens``` where the app saves the TGTG credentials after login. These credentials will be reused on every start of the container to avoid the mail login process. To login with a different account you have to delete the created volume.
62
+
The container automatically creates a volume mounting `\tokens` where the app saves the TGTG credentials after login. These credentials will be reused on every start of the container to avoid the mail login process. To login with a different account you have to delete the created volume or the files in it.
57
63
58
64
### Run from source
59
65
60
-
Method for developers.
66
+
Method for advanced usage.
67
+
68
+
1. Install Python>=3.9 and pip
69
+
2. Run `pip install -r requirements.txt`
70
+
3. Create `src/config.ini` as described in the file `config.template.ini`
71
+
4. Run `python src/main.py`
72
+
73
+
Alternatively you can use environment variables as described in the `sample.env` file. The scanner will look for environment variables if no `config.ini` is present.
74
+
75
+
### Build your own binary
76
+
77
+
You could also build your own binary for your OS/Arch combination.
61
78
62
79
1. Install Python>=3.9 and pip
63
-
2. Run ```pip install -r requirements.txt```
64
-
3. Create ```src/config.ini``` as described in the file ```config.template.ini```
65
-
4. Run ```python src/main.py```
80
+
2. Run `pip install -r requirements-build.txt`
81
+
3. Run `make executable` or `pyinstaller scanner.spec`
66
82
67
-
Alternatively you can use environment variables as described in the ```sample.env``` file. The scanner will look for environment variables if no ```config.ini``` is present.
83
+
You will find the bundled binary including the `config.ini` in the `./dist` directory.
68
84
69
-
### Running
85
+
##Usage
70
86
71
87
When the scanner is started it will first try to login to your TGTG account. Similar to logging in to the TGTG app, you have to click on the link send to you by mail. This won't work on your mobile phone if you have installed the TGTG app, so you have to check your mailbox on PC.
72
88
73
89
After a successful login the scanner will send a test notification on all configured notifiers. If you don't receive any notifications, please check your configuration.
74
90
91
+
### Helper functions
92
+
93
+
The executable or the `src/main.py` contains some useful helper functions that can be accessed via optional command line arguments. Running `scanner(.exe) --help` or `python src/main.py --help` displays the available commands.
Enabling the metrics option will expose a http server on the specified port supplying the currently available items. You can scrape the data with prometheus to create and visualize historic data or use it with your home automation.
@@ -88,54 +125,31 @@ Scrape config:
88
125
- 'localhost:8000'
89
126
````
90
127
91
-
## Developing
128
+
## Developement
92
129
93
-
For development I recommend using docker. The Makefile depends on docker and docker-compose.
130
+
For development I recommend using docker.
94
131
95
-
Create ```.env``` based on ```sample.env``` for configuration.
132
+
If you are developing with VSCode, you can open the project in the configured development container.
96
133
97
-
Developing with VSCode you can open the project in the configured development container.
98
-
99
-
### Makefile commands
100
-
101
-
```make image``` builds docker image with tag ```tgtg-scanner:latest```
102
-
103
-
```make install``` installs dependencies
104
-
105
-
```make start``` short for ```python src/main.py```
106
-
107
-
```make bash``` starts dev python docker image with installed dependencies and mounted project in bash
108
-
109
-
```make executable``` creates bundled executable in ```/dist```
110
-
111
-
```make test``` runs unit tests
112
-
113
-
```make clean``` cleans up docker compose
114
-
115
-
### Helper functions
116
-
117
-
```src/main.py``` contains some useful helper functions that can be accessed via optional command line arguments. Running ```python src/main.py --help``` displays the available commands.
134
+
To install all required dependencies for the developement environment, including linting, testing and building, run
-`make image` builds docker image with tag `tgtg-scanner:latest`
143
+
-`make install` installs dependencies
144
+
-`make start` short for `python src/main.py`
145
+
-`make bash` starts dev python docker image with installed dependencies and mounted project in bash
146
+
-`make executable` creates bundled executable in `/dist`
147
+
-`make test` runs unit tests
148
+
-`make clean` cleans up docker compose
135
149
136
150
### Creating new notifiers
137
151
138
-
Feel free to create and contribute new notifiers for other services and endpoints. You can use an existing notifier as template.
152
+
Feel free to create and contribute new notifiers for other services and endpoints. You can use an existing notifier as template or build upon the webhook notifier. E.g. see the [ifttt notifier](https://github.com/Der-Henning/tgtg/blob/main/src/notifiers/ifttt.py).
139
153
140
154
---
141
155
If you want to support me, feel free to buy me a coffee.
0 commit comments