Flask API which accepts a UTC Hour, and returns the Hour for the Requesting IP's Timezone
# Request your physical timezone equivilent for 8pm (20:00):
curl http://<server>/localhour/20
If the request is for '20' (8pm UTC), and the request comes from a UTC+5 timezone, the return will be:
{ "hour": 1 }
If the request is invalid (for example, from a local IP), an error will be displayed instead, eg:
{ "error": "no geoip match for IP 127.0.0.1" }
This app will not work for local IP addresses. Please be sure to test it with an external IP :)
To run in docker:
git clone https://github.com/dalgibbard/localhourcd dockerbuildcp ../localhour/Dockerfile .docker build --no-cache=true -t localhour .docker run -d -p 8000:80 --name localhour localhourdocker run -d -p 80 --name localhour dalgibbard/localhourContent type
Image
Digest
Size
202.2 MB
Last updated
over 10 years ago
docker pull dalgibbard/localhour