doerrfeldbill / sunrise

A super simple website that uses open data APIs to find the sunrise time in your local area. Essentially a clone of sunset repo.

Home Page:https://doerrfeldbill.github.io/sunrise/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

sunrise 🌄

sunrise is a super simple website that uses open data APIs to display the sunrise time in your local timezone. I built it to demo an introductory lesson on practical API use cases. This is a personal project and not intended for commercial use. View it here.

About

sunrise demonstrates how to use simple HTTP GET calls to open data APIs. First, the code calls the GeoIPLookup.io API to return lattitude and longitude coordinates based on the caller's IP address. Next, it uses passess these coordinates as parameters in a call to the Sunrise-Sunset API. The Sunrise-Sunset API returns the UTC timestamp for the sunrise time. Lastly, sunrise converts UTC into local time. It uses some JS functions to do that, and some janky slice methods to output what we want to see.

Disclaimer

Since sunrise depends on the caller's IP address, mobile use may return an incorrect time. Code is not elegant, it's just for sample purposes.

About

A super simple website that uses open data APIs to find the sunrise time in your local area. Essentially a clone of sunset repo.

https://doerrfeldbill.github.io/sunrise/


Languages

Language:JavaScript 49.0%Language:HTML 25.9%Language:CSS 25.0%