Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
curl -o covid19-data.zip https://www.covid19.admin.ch` \
curl -s https://www.covid19.admin.ch/en/ \
| grep -o '"[^"]*sources-json.zip"' \
| cut -d '"' -f 2`
@rkaravia
Copy link
Author

rkaravia commented Feb 8, 2021

Explanation:

  • Load the document at https://www.covid19.admin.ch/en/ and find occurrences of "{something}sources-json.zip"
  • This gives us a relative URL like "/api/data/20210205-sb227w4p/downloads/sources-json.zip"
  • Remove the quotation marks => /api/data/20210205-sb227w4p/downloads/sources-json.zip
  • Prepend https://www.covid19.admin.ch to the relative URL, download and save as covid19-data.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment