Table of Contents
TFI Notifier is a simple Node application that scrapes fund data from the inPZU website, summarises it, and sends a daily report. It helps you better track your investments and lets you know if the indexes are falling.
The application is hosted on the Vercel platform as a serverless function and is triggered every day by a CRON job.
Normally, this kind of application would probably just call a backend API to get the required data, but unfortunately, in this case, it was not possible. To bypass API security, the notifier is using the UPDATE: Thanks to a bit of reverse engineering, a reliable way of getting data from the API has been found. In case of any issues in the future, scrapping logic might be reverted. After processing the gathered data, it is sent to the end-user's email via the Resend service.puppeteer-core package to run the chromium instance and scrape the data out of it.
Values used to control the behaviour of the application.
| Name | Description | Example |
|---|---|---|
RESEND_KEY |
API key to authenticate the requests | re_dE... |
CRON_SECRET |
Random key to restrict the function triggering | c0Af... |
Email_Recipient |
Email of the user to receive the report | test@example.com |
Fund_{key}_Id |
Id of the fund index | 300 |
Fund_{key}_Ref |
Reference value of the fund to calculate gain/loss | 102.13 |
keycan be any value that does not contain underscores ('_').
- Clone the repository.
- Run
npm install(check.nvmrcfile for the Node version used). - Install Vercel CLI (
npm i -g vercel@latest). - Run
npm run run-local. - Follow the Vercel CLI steps.
- Add environmental variables on the Vercel website.
MIT License
Copyright (c) 2024 Mateusz Ciągło
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.