Skip to content

Instantly share code, notes, and snippets.

@raine
Created December 6, 2018 08:56
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 raine/f975f8441763be3ffe3290743efe9600 to your computer and use it in GitHub Desktop.
Save raine/f975f8441763be3ffe3290743efe9600 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
curl -s https://restcountries.eu/rest/v2/all | \
html-table -o \
--cols flag,code,name,population,area,capital,tld,languages \
--col.flag.cell '<div style="text-align: center"><img src="${flag}" height="20" /></div>' \
--col.flag.header '' \
--col.flag.width 50 \
--col.code.width 40 \
--col.code.cell '${alpha2Code}' \
--col.code.header '' \
--col.name.cell '<span>${name} (${nativeName})</span>' \
--col.name.filterable \
--col.tld.cell '<code>${topLevelDomain[0]}</code>' \
--col.tld.header 'TLD' \
--col.tld.width 50 \
--col.languages.cell '<span>${languages.map(x => x.name).join(", ")}</span>' \
--col.languages.header 'Languages' \
--col.population.cell '${population.toLocaleString()}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment