Created
May 26, 2022 18:11
-
-
Save dardo82/b533281487b27625d1fe7e1ca1f3a117 to your computer and use it in GitHub Desktop.
Ghibellina rush hours
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
#!/bin/sh | |
WEEK=($(LC_ALL="POSIX" locale -k day | gawk -v FS=';' -v RS='"' '/[a-z]$/')) | |
open "https://goo.gl/maps/VrA8z886JGGvYvBh7"; sleep 10; N="${#WEEK}"; SEQ=$(seq 0 $[$N-1]) | |
CHT="cht=p"; CHS="chs=999x999"; CHP="chp=$(bc -l <<< '6*a(1)')"; CHL="chl=$(seq -s '|' 7 19)"; N="6" | |
CHLPS="chlps=font.size,25|textStrokeWidth,5|textStrokeColor,FFFFFF|color,000000|align,end|offset,200" | |
CHCO="chco=7F7F7F|7F0000|FF0000|FF7F00|FFFF00|7FFF00|00FF00|00FF7F|00FFFF|007FFF|0000FF|7F00FF|FF00FF" | |
TAB=($(chrome-cli source | gawk -v FS='%? ' -v RS='"' '/ [0-9]+% .*:00/ {if ($3 != 0) print $3}' | rs -C',' $N)) | |
API="https://image-charts.com/chart"; for i in $SEQ; do CHD="chd=t:${TAB[i]}"; PNG="chart-${WEEK[i+1]}.png" | |
URL="$API?$CHT&$CHP&$CHS&$CHCO&${CHL%|}&$CHLPS&${CHD%,}"; curl -o "$PNG" "$URL"; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment