Scraping utility to supply mensatt with fresh dishes ๐
There are two projects included in the solution:
- MensattScraper, the scraping tool itself
- MensattScraper.Tests, various tests to improve reliability
- [Build] Dotnet Core >= 6.0
- [Runtime] Postgres database
- [Runtime] Werkswelt api url for fetching the menu
- [Runtime, Optional] Webhook url for providing status updates
- [Runtime, Optional] Docker
Building should be as simple as:
git clone https://github.com/mensatt/scraper.git
cd scraper/
dotnet build
xUnit is used as a testing framework, which integrates nicely with dotnet.
Testing your solution can be done by running dotnet test
in the sources root.
If you want to run the scraper yourself, please ensure that the following environment variables are set:
MENSATT_SCRAPER_API_URL
- url to a valid xml menu fileMENSATT_SCRAPER_DB
- database connection string, as required by Npgsql
Logs are written to console output by default, but you can mirror those messages using a supported webhook. For this the following environment variable needs to be defined:
MENSATT_SCRAPER_WEBHKOOK
- url to post a webhook to
You can either run the scraper from source by executing dotnet run
or build the solution and run its generated artefacts.
Keep in mind that you can only run the resulting executables on the same platform as they were built on.
We appreciate all contributions, whether it is through bug reports or pull requests. Please keep the following things in mind:
- If you find a bug, please check whether this bug was already reported in the issue tracker
- If you want to contribute code changes, please adhere to the following workflow:
- Fork and clone the repository
- Create a new branch
- Make your changes, fix some bugs ๐ชฒ๐จ
- Check whether everything builds successfully and run the unit tests
- Push your branch to your repository and submit a pull request against the scraper/main branch
- If the main branch was updated before your change was merged, please rebase your branch to integrate the new changes using
git rebase upstream/main
- After your change has been merged, you can safely delete your local branch
Try to keep your code style similar to the existing code.