Zwift gnome desktop widget #240
glennvl
started this conversation in
Show and tell
Replies: 1 comment
-
|
Apparently there is not necessarily a climb, workout, and route every week. So we cannot rely on the three being present when extracting the information from the zwift insider calendar. Updated command: bash <<-EOF
EVENTS_OTW=\$(curl --max-time 10 --retry 3 -s "https://zwiftinsider.com/weekly-challenges/" | hxclean | hxselect 'table.calendar-table td.current-day span.spiffy-event-group' 2>/dev/null)
for category in "Climb:370" "Workout:369" "Route:367"; do
IFS=":" read -r label id <<< "\$category"
event=\$(echo "\$EVENTS_OTW" | hxselect -c "span.category_\$id span.event-title" | sed 's/ ([0-9]\+XP)//g')
[ -n "\$event" ] && echo "\$label: \$event"
done
EOF |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I often find myself...
So I created a little gnome widget that pulls the above information and shows it on my desktop.
Want to try this yourself?
Install the Desktop Widget Gnome Extension and add a custom widget with the following configuration.
Create a new custom widget
Go to the Desktop Widget settings page and add a new custom widget.
Add the logo
Add a new element of type logo. This is the image I used.
Add the zwift version
Add a new element of type command. The command to fetch the latest zwift version is:
Add the climb/route/workout of the week
Add a new element of type command. The command that fetches this information from the ZwiftInsider article is:
Note that to parse the html and extract the date the
hxcleanandhxselectcommands are used. Those can be found in thehtml-xml-utilspackage (install withsudo dnf install html-xml-utilsorsudo apt install html-xml-utils).Beta Was this translation helpful? Give feedback.
All reactions