Update a gist to contain your recently watched movies from trakt.tv
📌✨ For more pinned-gist projects like this one, check out: https://github.com/matchai/awesome-pinned-gists
This code was heavily inspired by @jacc's music-box.
- Create a new public GitHub Gist (https://gist.github.com/).
- Create a token with the
gist
scope and copy it. (https://github.com/settings/tokens/new). - Create a Trakt.tv Application and copy the
API token
(https://trakt.tv/oauth/applications/new).
- Fork this repo.
- Go to your fork's
Settings
>Secrets
>Add a new secret
for each environment secret (below). - Activate github workflows on
Actions
>I understand my workflows, go ahead and run them
. - Star your own fork to trigger the initial build. Then the gist will update hourly. You can then go to your profile and pin the gist.
Set the following environment secrets on github.com/<github username>/movie-box
> Settings
> Secrets
:
- GIST_ID: The ID portion from your gist url
https://gist.github.com/<github username>/
<gist ID>
. - GH_TOKEN: The GitHub token generated above.
- TRAKT_ID: The Client ID you got from creating a Trakt.tv app.
- TRAKT_USERNAME: Your Trakt.tv username.
- MOVIE_BOX_MODE: Select the box mode from three options:
movies
,shows
andstats
.
-
You can test the script locally with Docker Compose:
-
Install Docker Community Edition according with your operating system
-
Install Docker Compose according with your operating system.
-
Install a git client.
-
Clone your fork of the repository into your local computer.
-
Open a terminal and navigate to the newly created folder.
-
Change to the
develop
branch.git checkout develop
-
Create a
.env
file with the content of the environment secrets as variables, like this (with real values):GIST_ID=xxxx GH_TOKEN=xxxx TRAKT_ID=xxxx TRAKT_USERNAME=xxxx MOVIE_BOX_MODE=xxxx
-
Execute the following command to create the docker image (first time only):
make image
-
Execute the following command to install node dependencies:
make dependencies
-
You can execute the update script with this command:
make update
-
Or, alternatively, open a console where you can manually execute the script and debug any errors:
make console node index.js
-
You can stop the docker container with:
make stop
-
Or, destroy it completely:
make destroy
-
Web luisalejandro.org · GitHub @LuisAlejandro · Twitter @LuisAlejandro