bot to add live scores to lemmy community for hockey games
Project description
A few things to note currently:
Without modifying files, there is currently no way to test this. I've tested that it works with old data, and will be testing/ fixing whatever needs it during the first preseason game of the Flyers (or earlier if someone reports an issue before this).
lemmy_nhl_bot
nhl linescore grabber/poster for lemmy. This app is meant to be run in the background to routinely add scores, standings, and team stats to a lemmy community focusing on a specific hockey team (standings are league wide, as is the draft function). After being configured, the main app is run in the background. It will check weekly for an updated schedule. Once per week (currently set to Sunday), it will post an updated League-wide standings page, and an updated team stats page. Once game days, it will start automatically at game time, and post scores and time updates every five seconds.
Docker image
There is a branch of this repo to aid in building a Docker image. To build and install with docker:
Download the following to a directory: (these are available on the release page beginning with 1.5.1) Dockerfile config.py
run:
python3 config.py
docker build -t lemmy_nhl_bot .
Building:
This script requires the following to be installed from pip: plemmy, requests, json
pip install plemmy source is https://github.com/tjkessler/plemmy/ Many thanks for tjkessler for the simple to use library!
pip install requests
pip install json
Build the .whl
git clone https://github.com/socphoenix/lemmy_nhl_bot.git
cd lemmy_nhl_bot
git checkout dev
Linux (FreeBSD use python3.9): python3 -m build . --wheel
cd dist
pip install lemmy_nhl-2.0.0-py3-none-any.whl
Usage:
Before starting bot.py, please make sure to run config.py! It is needed to save your login token and teamID/community Name. Without these the script will crash!
Run config.py:
Linux: lemmy_nhl_config
FreeBSD: lemmy_nhl_config.py ##This requires path set. for sh (default shell): "PATH=${PATH}:/home/'put user here'/.local/bin" "export PATH" (as an interesting note, python seems to only add the path to the root user during install)
run daemon
Unix:
lemmy_nhl_daemon
add " &" to run in the background. Working on creating service files but they are not done yet.
run draft bot
Unix: lemmy_nhl_draft
See it in action!
To see what the bot can currently do, look here: pinned game, stats, standings
Shared Libraries
This uses the Plemmy library, which is also released under the Apache 2.0 license. Many thanks to tjkessler for the simple to use library!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for lemmy_nhl-1.5.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c3695daf1992d27917d241a0ef56272e904a0c0807bff47241b477676df3cbb1 |
|
MD5 | 02ede5941476d035a0f80e2935b8d363 |
|
BLAKE2b-256 | 5096fae905c5c46fb6afb327b5b7a9edbdba9010c4d3912171a04ca05ead7051 |