Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save paulmaunders/29cb985af81f126cb0db20cc9393faf8 to your computer and use it in GitHub Desktop.
Save paulmaunders/29cb985af81f126cb0db20cc9393faf8 to your computer and use it in GitHub Desktop.
Last 14 days COVID-19 hospital patients in England
curl --compressed 'https://api.coronavirus.data.gov.uk/v1/data?filters=areaType=nation;areaName=England&structure=%7B%22date%22:%22date%22,%22hospitalCases%22:%22hospitalCases%22%7D&format=xml' | ggrep -Pio "<hospitalCases>\K([^<]+)" | perl -e "print reverse(<>)" | tail -n 14 | paste -sd "," -
@paulmaunders
Copy link
Author

Note that this requires GNU grep to get the Perl Compatible Regular Expressions to work on OSX. You can install through brew:

brew install grep

It can then be used via ggrep

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