Coder Social home page Coder Social logo

olivierluethy / sunset-sunrise-time Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 49 KB

Get the sunset and sunrise time based on your entered location. You must have your own API_KEY to use this application properly.

HTML 10.71% JavaScript 39.30% CSS 23.16% SCSS 26.83%

sunset-sunrise-time's Introduction

Sunset-Sunrise-Time

This is a JavaScript program that fetches weather data from the OpenWeatherMap API based on the location input by the user and displays the sunrise and sunset times for that location in the local time zone. It also displays the current date along with the icons for sunrise and sunset. If the API does not return valid data, it displays an error message instead. The program uses event listeners to detect button clicks and updates the HTML output accordingly.

Setup

To use this project, you'll need to create an account at OpenWeather, as the project pulls data from their API.

Once you've created an account, navigate to your profile by clicking on your name in the top navigation between For Business and Support. From there, click on My API Keys. If you don't have an API key, create one.

Next, create a new file in the project called apikey.js. In that file, write the following code and paste your API key:

const apiKey = "YOUR_API_KEY";

Finally, save the file and you're ready to go!

sunset-sunrise-time's People

Contributors

olivierluethy avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.