# 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](https://github.com/socphoenix/lemmy_nhl_bot/tree/docker) 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](https://github.com/socphoenix/lemmy_nhl_bot/blob/c056d557951d1e9bae1ab602c22b9e5b7788c03b/Dockerfile)
> [config.py](https://github.com/socphoenix/lemmy_nhl_bot/blob/c056d557951d1e9bae1ab602c22b9e5b7788c03b/config.py)
>
> run:
>
> python3 config.py
>
> docker build -t lemmy_nhl_bot .
>
> docker run lemmy_nhl_bot &
# Building:
This script requires the following to be installed from pip: plemmy, requests, json, build
> pip install plemmy >= 0.3.0 source is https://github.com/tjkessler/plemmy/ Many thanks for tjkessler for the simple to use library!
> pip install requests
> pip install json
> pip install build
## 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 lemmy_nhl_daemon, please make sure to run config.py! It is needed to save your login token and teamID/community Name. Without these the script will not work!
### Run config.py:
> Linux: lemmy_nhl_config
>FreeBSD: lemmy_nhl_config ##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)
Configuration Options:
#### Server: Which server the bot will connect to e.g.(https://enterprise.lemmy.ml)
#### username: account name of the bot (please don't use your normal account for this bot! it's bad practice. Create a bot account instead)
#### password: Where your password should go
#### teamID: pick your team number from the options listed e.g.(4 for the Philadelphia Flyers)
#### Community: name of the community you are posting to
#### isMod: This bot can't pin posts or run the schedule bot without moderator privileges on the community
#### bots: select y on the first prompt to enable them all. The bots are:
- stats: post a selection of stats from your selected team once per week (Sunday)
- standings: post league-wide standings to the community once per week (Sunday)
- schedule: Every Sunday update the sidebar with the next weeks games (note this assumes it can cut and replace anything
that comes after a "*** " mark on the sidebar. It will preserve everything before that like community rules)
- linescore: This will check for a game in progress every 5 minutes, and then create/pin a post to the community
that displays time left, goals broken up by period, shots on goal broken up by period, if a team is on the powerplay,
any video highlights the api will give, and after the game adds a recap to the game post before unpinning the post.
** note on bots. Current version will check and only start/run stats/standings beginning in October.
### run daemon
Linux:
> lemmy_nhl_daemon &
>
> FreeBSD:
> daemon lemmy_nhl_daemon
> Docker: docker run lemmy_nhl (or whatever you named the container image during building)
### run draft bot
Unix: lemmy_nhl_draft
# See it in action!
To see what the bot can currently do, look here: [pinned game](https://enterprise.lemmy.ml/post/417139), [stats](https://enterprise.lemmy.ml/post/417090), [standings](https://enterprise.lemmy.ml/post/417089)
# Shared Libraries
This uses the [Plemmy](https://github.com/tjkessler/plemmy/) library, which is also released under the Apache 2.0 license.
Many thanks to tjkessler for the simple to use library!
Raw data
{
"_id": null,
"home_page": "https://github.com/socphoenix/lemmy_nhl_bot",
"name": "lemmy-nhl",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "lemmy,hockey,bot",
"author": "socphoenix",
"author_email": "",
"download_url": "https://files.pythonhosted.org/packages/41/51/1a96995045bd04ed0cb4e23cf5c60a23290fcdbe7aeda970e93da8c3e600/lemmy_nhl-1.5.11.tar.gz",
"platform": null,
"description": "# A few things to note currently:\n\n> Without modifying files, there is currently no way to test this. I've tested that it works with old data, and will be testing/\n> fixing whatever needs it during the first preseason game of the Flyers (or earlier if someone reports an issue before this).\n\n\n# lemmy_nhl_bot\n\nnhl linescore grabber/poster for lemmy. This app is meant to be run in the background to routinely add scores, standings, and team\nstats to a lemmy community focusing on a specific hockey team (standings are league wide, as is the draft function). After being\nconfigured, the main app is run in the background. It will check weekly for an updated schedule. Once per week\n(currently set to Sunday), it will post an updated League-wide standings page, and an updated team stats page. Once game days, it\nwill start automatically at game time, and post scores and time updates every five seconds.\n\n\n# Docker image\n\nThere is a [branch](https://github.com/socphoenix/lemmy_nhl_bot/tree/docker) of this repo to aid in building a Docker image.\nTo build and install with docker:\n\n> Download the following to a directory:\n> (these are available on the release page beginning with 1.5.1)\n> [Dockerfile](https://github.com/socphoenix/lemmy_nhl_bot/blob/c056d557951d1e9bae1ab602c22b9e5b7788c03b/Dockerfile)\n> [config.py](https://github.com/socphoenix/lemmy_nhl_bot/blob/c056d557951d1e9bae1ab602c22b9e5b7788c03b/config.py)\n>\n> run:\n>\n> python3 config.py\n>\n> docker build -t lemmy_nhl_bot .\n>\n> docker run lemmy_nhl_bot &\n\n\n# Building:\n\n This script requires the following to be installed from pip: plemmy, requests, json, build\n\n> pip install plemmy >= 0.3.0 source is https://github.com/tjkessler/plemmy/ Many thanks for tjkessler for the simple to use library!\n\n> pip install requests\n\n> pip install json\n\n> pip install build\n\n\n## Build the .whl\n> git clone https://github.com/socphoenix/lemmy_nhl_bot.git\n>\n> cd lemmy_nhl_bot\n>\n> git checkout dev\n>\n> Linux (FreeBSD use python3.9): python3 -m build . --wheel\n>\n> cd dist\n>\n> pip install lemmy_nhl-2.0.0-py3-none-any.whl\n\n## Usage:\nBefore starting lemmy_nhl_daemon, please make sure to run config.py! It is needed to save your login token and teamID/community Name. Without these the script will not work!\n\n### Run config.py:\n> Linux: lemmy_nhl_config\n\n>FreeBSD: lemmy_nhl_config ##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)\n\nConfiguration Options:\n#### Server: Which server the bot will connect to e.g.(https://enterprise.lemmy.ml)\n\n#### username: account name of the bot (please don't use your normal account for this bot! it's bad practice. Create a bot account instead)\n\n#### password: Where your password should go\n\n#### teamID: pick your team number from the options listed e.g.(4 for the Philadelphia Flyers)\n\n#### Community: name of the community you are posting to\n\n#### isMod: This bot can't pin posts or run the schedule bot without moderator privileges on the community\n\n#### bots: select y on the first prompt to enable them all. The bots are:\n - stats: post a selection of stats from your selected team once per week (Sunday)\n\n - standings: post league-wide standings to the community once per week (Sunday)\n\n - schedule: Every Sunday update the sidebar with the next weeks games (note this assumes it can cut and replace anything\n that comes after a \"*** \" mark on the sidebar. It will preserve everything before that like community rules)\n\n - linescore: This will check for a game in progress every 5 minutes, and then create/pin a post to the community\n that displays time left, goals broken up by period, shots on goal broken up by period, if a team is on the powerplay,\n any video highlights the api will give, and after the game adds a recap to the game post before unpinning the post.\n\n ** note on bots. Current version will check and only start/run stats/standings beginning in October.\n\n### run daemon\n\nLinux:\n > lemmy_nhl_daemon &\n >\n > FreeBSD:\n > daemon lemmy_nhl_daemon\n\n > Docker: docker run lemmy_nhl (or whatever you named the container image during building)\n\n\n### run draft bot\n\nUnix: lemmy_nhl_draft\n\n\n# See it in action!\n\nTo see what the bot can currently do, look here: [pinned game](https://enterprise.lemmy.ml/post/417139), [stats](https://enterprise.lemmy.ml/post/417090), [standings](https://enterprise.lemmy.ml/post/417089)\n\n\n# Shared Libraries\n\nThis uses the [Plemmy](https://github.com/tjkessler/plemmy/) library, which is also released under the Apache 2.0 license.\nMany thanks to tjkessler for the simple to use library!\n",
"bugtrack_url": null,
"license": "Apache 2.0",
"summary": "bot to add live scores to lemmy community for hockey games",
"version": "1.5.11",
"project_urls": {
"Homepage": "https://github.com/socphoenix/lemmy_nhl_bot"
},
"split_keywords": [
"lemmy",
"hockey",
"bot"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "c6f9748abeb61b9b00515b7ba71ef390d927601e112da14d0f594ce3a9fea881",
"md5": "b4eea5eb7c3e23307a8f243e17610a7c",
"sha256": "8cb2bb34c19bbab95dcc53a7e22fa1853648a8ad563e23958153207682e47f14"
},
"downloads": -1,
"filename": "lemmy_nhl-1.5.11-py3-none-any.whl",
"has_sig": false,
"md5_digest": "b4eea5eb7c3e23307a8f243e17610a7c",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 17349,
"upload_time": "2023-10-28T15:45:41",
"upload_time_iso_8601": "2023-10-28T15:45:41.936631Z",
"url": "https://files.pythonhosted.org/packages/c6/f9/748abeb61b9b00515b7ba71ef390d927601e112da14d0f594ce3a9fea881/lemmy_nhl-1.5.11-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "41511a96995045bd04ed0cb4e23cf5c60a23290fcdbe7aeda970e93da8c3e600",
"md5": "719bb4303484db950ae11b151b57cccf",
"sha256": "0998c6f201d4574764533915e909d8cbdce084a79261d38ff9e3f4dd01195b50"
},
"downloads": -1,
"filename": "lemmy_nhl-1.5.11.tar.gz",
"has_sig": false,
"md5_digest": "719bb4303484db950ae11b151b57cccf",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 16045,
"upload_time": "2023-10-28T15:45:43",
"upload_time_iso_8601": "2023-10-28T15:45:43.242779Z",
"url": "https://files.pythonhosted.org/packages/41/51/1a96995045bd04ed0cb4e23cf5c60a23290fcdbe7aeda970e93da8c3e600/lemmy_nhl-1.5.11.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-10-28 15:45:43",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "socphoenix",
"github_project": "lemmy_nhl_bot",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "lemmy-nhl"
}