An automated service that updates the r/SUNS sub-reddit sidebar with the latest Phoenix Suns roster & schedules!
Explore the docs »
View Project
·
Report Bug
·
Request Feature
Table of Contents
As our amazing basketball community grows, the r/SUNS subreddit is developing tools like this sidebar generator to help automate tasks which helps promote the highest quality of content. The "Phoenix Suns Sidebar Generator" retrieves the latest NBA data and creates a subreddit sidebar tables with the pertinent details of game scores, players, and other fun statistics.
The following prerequisites and requirements are necessary for the success of this project:
Setup your project environment by installing node dependencies (npm i
),
add variables, add parameters, & select a deployment method:
- (ad-hoc) Using main module
- (ad-hoc) Using built-in cron
- (automation) Using Docker
Rename .env.sample
to .env
and add the variables with the appropriate values.
TZ=America/New_York # TimeZone
CRON=0|1 # Enable Cron support
VERSION=1.0.0 # package.json project version
CLIENT_ID=ABcD0fghIj2kLMNopqRSTUv # See Reddit API documentation
CLIENT_SECRET=A1Bc_D_EfG2hIjK3LmnoPQrs4tu # See Reddit API documentation
ACCESS_TOKEN=abcDeFghiJKlMnOPqRsTUVWxYz01234567890... #See Reddit API documentation
REFRESH_TOKEN=01234567890123-abcDEfGhIJKLmnopqRst0UV12Wxy-z # See Reddit API documentation
Rename config/parameters.sample
to config/parameters.json
and add the keys
with the appropriate values.
- Run the following NPM script:
npm run start
ornode ./bin/index.mjs
- Specify a cron schedule in
config/parameters.json
- Add
CRON=1
in.env
- Run the following NPM script:
npm run start:cron
ornode ./bin/cron.mjs
-
Add version number to the
VERSION
in.env
-
Add
CRON=1
in.env
-
For no prompting, build with the following NPM script:
npm run build:docker:force
-
For prompting, build with the following NPM script:
npm run build:docker
# example # docker run -d --env-file .env --name sidebar-1.0.0 sunsreddit/sidebar:1.0.0
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/project-id
) - Commit your Changes (
git commit -m 'Add the thing'
) - Push to the Branch (
git push origin feature/project-id
) - Open a Pull Request
TO DO | Description | Status |
---|---|---|
Usage | Add "Usage" instructions in the README.md | ✅ |
Automation | A Docker service that automates the projects actions | ✅ |
Unit Tests | Jest UTs for all project modules | ✅ |
GitHub Actions | Continuous integration and project automation | 🚧 Ongoing |
Distributed under the MIT License. See LICENSE for more information.