Skip to main content

Get a Telegram message whenever a wakeboard session with the LakeRiders club becomes available

Project description

LAKERIDERS ALERT

DESCRIPTION

This is a Python script that scrapes the website of LakeRiders Geneva to search for available spots for a wakeboard session. It alerts the user of available sessions through a Telegram bot

LOGIC

  • The script scrapes the calendar of upcoming sessions in the website every 2 minutes.
  • It compares the reserved sessions with the ones from the previous session, which are stored in a LiteSQL DB.
  • In case a session has become available (because of cancellation by a member), the script sends a message to a Telegram private group through a Telegram bot.

PREREQUISITES

To run the script, a series of "secrets" are needed. Namely you need:

  • An account at LakeRiders Geneva, characterized by an email and a password
  • A Telegram bot, characterized by a bot token.
  • A chat with the Telegram bot, characterized by a chat id. One way of obtaining the chat id is by running
curl https://api.telegram.org/bot<YOUR_BOT_TOKEN>/getUpdates

The chat id is available in the response.

RUNNING LAKE RIDERS ALERT

From PyPI

LakeRiders Alert is published as a PyPI package at https://pypi.org/project/lakeriders-alert/

pip install lakeriders-alert

lakeridersalert

From this repo

From the root directory:

pip install -e .

lakeridersalert

The first step installs the required dependencies and creates the lakeridersalert comman that launches the script.

Entering your secrets

Unless you have defined your secrets as environment variables, when launching LakeRiders Alert you will be prompted to enter the secrets mentioned in the prerequisites section above.

If you want to use the env variables approach, define the secrets as

export LOGIN_EMAIL=<YOUR_LOGIN_EMAIL>
export LOGIN_PASSWORD=<YOUR_LOGIN_PASSWORD>
export BOT_TOKEN=<YOUR_BOT_TOKEN>
export CHAT_ID=<YOUR_CHAT_ID>

Also, if you want LakeRidersAlert to print log messages in the console, set the environment variable RUN_WITH_LOGS to a truthy value before starting the script.

RUNNING TESTS

From the root directory:

python -m unittest discover

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lakeriders_alert-0.1.2.tar.gz (9.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lakeriders_alert-0.1.2-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

Details for the file lakeriders_alert-0.1.2.tar.gz.

File metadata

  • Download URL: lakeriders_alert-0.1.2.tar.gz
  • Upload date:
  • Size: 9.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.12

File hashes

Hashes for lakeriders_alert-0.1.2.tar.gz
Algorithm Hash digest
SHA256 a34c2eac93c4210fad8ebe86d3c5b0c79304faada6b911600cba1e552a6fd053
MD5 c37ca450200c9bc3c176df493d31ee18
BLAKE2b-256 a8438130eeda1f9f307861d59152af4c19ab89546b306e4bdfc6753608580cd3

See more details on using hashes here.

File details

Details for the file lakeriders_alert-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for lakeriders_alert-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 19941b4b5dd5fa89ddc710f139eebadfb34d1a42c6379f90fa1fb504a386e451
MD5 e25f2311d4fb91389100bb14c0edec02
BLAKE2b-256 165b6b40aaedd5878e63bfeadf70fbf4dd3fdd3ebf1fe3da23ad3948886b988c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page