This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
There are two parts to this: | |
1. The main Python code that uses requests + json to parse the events | |
2. The external Jinja2 template that the data is rendered by, producing the HTML output | |
# ---------------------------------------------------------------------------------------------------------------- | |
#!/usr/bin/env python3 | |
import json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
There are two parts to this: | |
1. The main shell script that calls curl and jq | |
2. The jq filter itself, an external file | |
# ---------------------------------------------------------------------------------------------------------------- | |
#!/bin/bash | |
events=$(curl --compressed -s 'https://us-or-rly101.zwift.com/api/public/events/upcoming') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@import url("https://use.fontawesome.com/releases/v5.13.1/css/all.css"); | |
/* Case status colors */ | |
.status-wocus{background-color:#9eebcf;} | |
.status-wosup{background-color:#ffb517;} | |
.status-woeng{background-color:#fbf1a9;} | |
.status-woups{background-color:#96ccff;} | |
.status-woops{background-color:#cdecff;} | |
.status-wocpc{background-color:#ad99ff;} | |
.status-wosru{background-color:#ff99e0;} | |
.status-wonew{background-color:#debe66;} |