Skip to content

Repository files navigation

TFI Notifier

Table of Contents
  1. About
  2. Technical overview
  3. Application setup
  4. License

About

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.

Technical overview

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 puppeteer-core package to run the chromium instance and scrape the data out of it.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.

Application setup

Environmental variables

Values used to control the behaviour of the application.

NameDescriptionExample
RESEND_KEYAPI key to authenticate the requestsre_dE...
CRON_SECRETRandom key to restrict the function triggeringc0Af...
Email_RecipientEmail of the user to receive the reporttest@example.com
Fund_{key}_IdId of the fund index300
Fund_{key}_RefReference value of the fund to calculate gain/loss102.13

key can be any value that does not contain underscores ('_').

Local setup

  1. Clone the repository.
  2. Run npm install (check .nvmrc file for the Node version used).
  3. Install Vercel CLI (npm i -g vercel@latest).
  4. Run npm run run-local.
  5. Follow the Vercel CLI steps.
  6. 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.

About

Simple application that scrapes fund data from the inPZU website, summarises it, and sends a daily report.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages