Skip to content
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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Conversation

dannytszho
Copy link

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

@@ -0,0 +1,44 @@
let weather = {
"apikey": "375090722ff9b13931a9ed44d6f32f14",
Copy link

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')">
Copy link

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
Copy link

@Rpsl Rpsl Dec 24, 2021

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">
Copy link

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.

@Rpsl
Copy link

Rpsl commented Dec 24, 2021

huh, i didn't look at the date of this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants