Basically I've been using this code to read json file from web API and it's pretty easy using bash with jq package.
#!/bin.bash
ip_country=$(curl -s "https://api.ipgeolocationapi.com/geolocate/123.123.123.123}" | jq --raw-output '.name')
if [ -z "$ip_country" ]; then
ip_country="Unknown"
fi
echo "${ip_country}"
But, in lua, I have done some research and seems like lunajson
is the best package to handle a json file (IMO). I know how to read a simple json file using lunajson
but I found no example how to use this to read json file from a website like the bash example. Is there a special package that I need to import in order to read the json file from website (like the bash example above)?