2023-05-15 15:18:46 +02:00
# Heisse Preise
2023-05-29 16:06:19 +02:00
A terrible grocery price search "app". Fetches data from big Austrian grocery chains daily and lets you search them. See < https: / / heisse-preise . io > .
2023-05-15 15:18:46 +02:00
2023-06-19 17:46:09 +02:00
The project consists of a trivial NodeJS Express server responsible for fetching the product data, massaging it, and serving it to the front end (see `server.js` ). The front end is a least-effort vanilla HTML/JS app (see sources in `site/` ).
2023-05-15 15:21:40 +02:00
2023-06-07 14:14:26 +02:00
## Requirements
- Node.js
## Running
2023-05-15 15:21:40 +02:00
2023-06-07 14:14:26 +02:00
### Development
2023-05-29 16:06:19 +02:00
2023-05-23 18:52:07 +02:00
Install NodeJS, then run this in a shell of your choice.
2023-05-29 16:06:19 +02:00
```bash
2023-05-23 18:52:07 +02:00
git clone https://github.com/badlogic/heissepreise
cd heissepreise
2023-06-19 17:45:08 +02:00
mkdir -p data
2023-05-23 18:52:07 +02:00
npm install
2023-06-07 14:14:26 +02:00
npm run dev
2023-05-23 18:52:07 +02:00
```
The first time you run this, the data needs to be fetched from the stores. You should see log out put like this.
2023-05-29 16:06:19 +02:00
```bash
2023-05-23 18:52:07 +02:00
Fetching data for date: 2023-05-23
2023-05-29 16:10:42 +02:00
Fetched LIDL data, took 0.77065160000324 seconds
Fetched MPREIS data, took 13.822936070203781 seconds
2023-05-23 18:52:07 +02:00
Fetched SPAR data, took 17.865891209602356 seconds
Fetched BILLA data, took 52.95784649944306 seconds
Fetched HOFER data, took 64.83968291568756 seconds
2023-05-24 20:02:45 +02:00
Fetched DM data, took 438.77065160000324 seconds
2023-05-23 18:52:07 +02:00
Merged price history
2023-06-07 14:14:26 +02:00
App listening on port 3000
2023-05-23 18:52:07 +02:00
```
2023-06-18 23:23:02 +02:00
Once the app is listening per default on port 3000, open < http: / / localhost:3000 > in your browser.
2023-05-23 18:52:07 +02:00
Subsequent starts will fetch the data asynchronously, so you can start working immediately.
2023-06-07 14:14:26 +02:00
### Production
Install the dependencies as per above, then simply run:
```
2023-06-19 17:45:08 +02:00
git clone https://github.com/badlogic/heissepreise
cd heissepreise
npm install
npm run dev
2023-06-07 14:14:26 +02:00
```
2023-06-19 17:45:08 +02:00
Once the app is listening per default on port 3000, open < http: / / localhost:3000 > in your browser.
2023-06-07 14:14:26 +02:00
2023-06-19 17:45:08 +02:00
## Using data from heisse-preise.io
2023-06-07 14:14:26 +02:00
2023-06-07 16:57:44 +02:00
You can also get the [raw data ](https://heisse-preise.io/data/latest-canonical.json ). The raw data is returned as a JSON array of items. An item has the following fields:
2023-06-07 14:14:26 +02:00
2023-06-19 17:45:08 +02:00
- `store` : (`billa`, `spar` , `hofer` , `dm` , `lidl` , `mpreis` , ...)
2023-06-07 14:14:26 +02:00
- `name` : the product name.
- `price` : the current price in €.
- `priceHistory` : an array of `{ date: "yyyy-mm-dd", price: number }` objects, sorted in descending order of date.
- `unit` : unit the product is sold at. May be undefined.
- `quantity` : quantity the product is sold at for the given price
- `bio` : whether this product is classified as organic/"Bio"
2023-06-13 22:30:00 +02:00
2023-06-19 17:45:08 +02:00
If you run the project locally, you can use the data from the live site including the historical data as follows:
```
cd heisse-preise
rm data/latest-canonical.*
curl -O data/latest-canonical.json https://heisse-preise.io/data/latest-canonical.json
```
Restart the server with either `npm run dev` or `npm run start` .
## Historical Data Credits
2023-06-13 22:30:00 +02:00
The live site at [heisse-preise.io ](https://heisse-preise.io ) feature historical data from:
- [Dossier ](https://www.dossier.at/dossiers/supermaerkte/quellen/anatomie-eines-supermarkts-die-methodik/ )
2023-06-14 00:08:28 +02:00
- [@h43z ](https://h.43z.one ), who runs [preisinflation.online ](https://inflation.43z.one ), another grocery price tracker.