-
Notifications
You must be signed in to change notification settings - Fork 184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added weather feature #21
base: master
Are you sure you want to change the base?
Conversation
@@ -0,0 +1,44 @@ | |||
let weather = { | |||
"apikey": "375090722ff9b13931a9ed44d6f32f14", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public apikey will be banned. you need to move it into ENV variable and enable weather feature only if apikey setted
@@ -12,7 +12,7 @@ | |||
<script src="https://code.iconify.design/1/1.0.7/iconify.min.js"></script> | |||
</head> | |||
|
|||
<body onload="loadFunctions()"> | |||
<body onload="loadFunctions(); weather.fetchWeather('san diego')"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also you need move place for weather forecast into ENV variable
fetchWeather: function (city) { | ||
fetch( | ||
"http://api.openweathermap.org/data/2.5/weather?q=" | ||
+ city |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i was use openweathermap forecast in several projects and i recommend use lat & lon
coordinates prefer city name. If you use city name this may not work well for people from other countries or small towns because of problems with synonyms.
See By geographic coordinates
for example https://openweathermap.org/current
</section> | ||
|
||
<section id="weather"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you need use handelbars-template
for rendering data. only if script get correct data from weather api.
huh, i didn't look at the date of this PR |
Hi Jeroenpardon,
I am pretty new to programming and I really like your startup page project. I added a weather feature with JS and HTML. I don't know if you would like that idea. I am currently still getting more familiar with CSS. I hope I can add more styling this weekend. Let me know what you think!
Best,
Danny