Skip to content

Instantly share code, notes, and snippets.

@ChrisSwanson
Created November 20, 2021 21:48
Show Gist options
  • Save ChrisSwanson/3f6b039b13474e456bf4b725ba9018eb to your computer and use it in GitHub Desktop.
Save ChrisSwanson/3f6b039b13474e456bf4b725ba9018eb to your computer and use it in GitHub Desktop.
AWS Regions JSON oneliner
# requires pup, and jq to be installed
# this is likely to break based on the css selector, but a quick hack for now.
curl "https://docs.aws.amazon.com/general/latest/gr/rande.html" | pup "#w420aac12b7b9c13 > tbody > tr json{}" | jq '.[].children | { region: .[1].text, name: .[0].text} ' | sed -e '$!s/"$/",/' | sed -e 's/}/},/'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment