Skip to main content

AWS CDK construct to send notifications for adds, drops, and trades in an ESPN Fantasy Hockey league

Project description

Fantasy Hockey Notifier CDK

AWS CDK construct to send notifications for adds, drops, and trades in an ESPN Fantasy Hockey league

NPM version PyPI version Release

This application checks for and sends notifications about adds, drops, and trades in an ESPN Fantasy Hockey league. All ESPN APIs used are unofficial and undocumented, thus this application may break at some point in the future if ESPN changes the response schema for any of the endpoints. The codebase supports local execution, along with deployment to AWS using AWS CDK.

Local Execution

In addition to being consumable as a CDK construct (which is the primary use-case), the project supports local execution for testing purposes.

Prerequisites for Local Execution

  • Node.js 14 or later
  • See the Environment Variables section for a list of required and optional variables that should be exported in the shell or set in the .env file
  • If using any of the environment variables starting with AWS_ or ending with _SSM, you must configure AWS credentials via a local credentials file or environment variables. See the AWS documentation for details.

Shell Commands for Local Execution

npm ci
npm start

API Reference

See API.md.

Environment Variables

Required Variables

FH_SEASON or FH_SEASON_SSM: The year of the fantasy hockey season (i.e. 2020 for the 2019-2020 season)

FH_LEAGUE_ID or FH_LEAGUE_ID_SSM: The ID of the ESPN fantasy hockey league (this is displayed in the URL when you go to the My Team page) or the path for an SSM parameter with this value (SSM variable takes prescedence if both are specified)

ESPN_S2_COOKIE or ESPN_S2_COOKIE_SSM: The value of your espn_s2 cookie to be used for authentication (you can find this by examining stored cookies for espn.com using the Chrome or Firefox developer tools) or the path for an SSM parameter with this value (SSM variable takes prescedence if both are specified)

Optional Variables

AWS_SNS_TOPIC_ARN: The ARN of an existing AWS SNS topic

AWS_DYNAMO_DB_TABLE_NAME or DISCORD_WEBHOOK_SSM: The name of an existing Dynamo DB table to use for storing last run dates (takes priority over LAST_RUN_FILE_PATH if both are set) or the path for an SSM parameter with this value (SSM variable takes prescedence if both are specified)

DISCORD_WEBHOOK: A Discord webhook URL

LAST_RUN_FILE_PATH: A local file path to use for storing last run dates (defaults to .lastrun)

EARLIEST_DATE: A unix timestamp in milliseconds to use as the earliest date when looking up transactions

LATEST_DATE: A unix timestamp in milliseconds to use as the latest date when looking up transactions

License

This project is licensed under the MIT License - see the LICENSE file for details

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

fantasy_hockey_notifier_cdk-2.0.64.tar.gz (9.1 MB view details)

Uploaded Source

Built Distribution

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

fantasy_hockey_notifier_cdk-2.0.64-py3-none-any.whl (9.1 MB view details)

Uploaded Python 3

File details

Details for the file fantasy_hockey_notifier_cdk-2.0.64.tar.gz.

File metadata

File hashes

Hashes for fantasy_hockey_notifier_cdk-2.0.64.tar.gz
Algorithm Hash digest
SHA256 dd883fc25c0b95ff0f1ea70b965927de58477f7a9c34f28048c7ad13de461f8c
MD5 534c8ccff05c7f3b1568eea1fd7fc335
BLAKE2b-256 099244929d9e5b3a9f16fc0330f65b4259466c5dac01a86306436128f41f4e64

See more details on using hashes here.

File details

Details for the file fantasy_hockey_notifier_cdk-2.0.64-py3-none-any.whl.

File metadata

File hashes

Hashes for fantasy_hockey_notifier_cdk-2.0.64-py3-none-any.whl
Algorithm Hash digest
SHA256 a8c5fde27f6c4bae6c256345ac4b1fcd9fe0484a89c1deb3296c6b4a92527a30
MD5 6ecdeb86335fba6fca22fe30ce2019ff
BLAKE2b-256 2f547414dd401d29a8bfa9177b3e2747d3e18867a4dd03f1ddb6f0839c43702b

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