Skip to content

Instantly share code, notes, and snippets.

@aynik
Created December 26, 2017 14:27
Show Gist options
  • Save aynik/a6c1cd989546bf765f61f8962f373ece to your computer and use it in GitHub Desktop.
Save aynik/a6c1cd989546bf765f61f8962f373ece to your computer and use it in GitHub Desktop.
Sun zenith
#!/usr/bin/env bash
echo -n $(for l in $(for l in $(grep -Eo 'class=r>(.*)+</tr' <(curl -s "https://www.timeanddate.com/worldclock/sunearth.html")); do echo $l | grep -v "^<"; done | head -n2); do echo -n $(echo -n $l | sed 's/&nbsp;//g' | sed 's/West/W/' | sed 's/South/S/' | sed 's/North/N/' | sed 's/East/E/' | sed 's/<\/td><td>/0"/' | cut -d'>' -f2 | cut -d'<' -f1),; done | cut -d',' -f-2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment