Countries

Build and run

cargo build --release
./target/release/countries

What does it do?

# In a nutshell, it does this
curl https://restcountries.com/v3.1/all | jq -r '[.[] | {"name": .["name"].["common"], "code": .["cca2"],"captial": .["capital"].[0], "population": .["population"]}]' > output.json
# But also downloads files from another api

Format of file countries.txt

Flag    Name    Capital Population
UA      Ukraine Kiev    44134693
...

Images

for each country generated in country.txt it also downloads flag {code}.png image

APIs

  1. https://restcountries.com/v3.1/all for file
  2. https://flagsapi.com/UA/flat/64.png for image retrieval