Jaredk3nt / homepage

Custom homepage for use locally in browser
MIT License
525 stars 153 forks source link

How to change the used objects given by the innerHTML code? #1

Closed dirsigler closed 2 years ago

dirsigler commented 5 years ago

Hey buddy,

thanks for this beautiful homepage. I am trying to change the openweather API to the darksky one.

Somehow I am not able to change the strings which are given to the innerHTML stuff from the JSON output.

The output of the JSON is:

{ "latitude": 51.11919, "longitude": 6.951266, "timezone": "Europe/Berlin", "currently": { "time": 1549020317, "summary": "Mostly Cloudy", "icon": "partly-cloudy-day", "precipIntensity": 0, "precipProbability": 0, "temperature": 3.62, "apparentTemperature": 0.06, "dewPoint": 1.04, "humidity": 0.83, "pressure": 990.58, "windSpeed": 4.18, "windGust": 6.4, "windBearing": 146, "cloudCover": 0.78, "uvIndex": 1, "visibility": 11.1, "ozone": 354.99 }, "offset": 1 }

what I do now is:

document.getElementById("temp").innerHTML = json.currently.temperature;//.toFixed(0) + " C";

But somehow it is blank on the homepage. Can you give me please a hint where I have to look?

Jaredk3nt commented 5 years ago

Could you post a gist of your index.html so I can run it? It looks fine to me from what you have explained.

dirsigler commented 5 years ago

https://gist.github.com/0xE02B7/0545ebbf0e9f5b318279bdb64ab50b61

Here it is. I am not a dev, that's why I have to ask this noobish question. But I really appreciate the clean code and given features and want to use this as a base to mix my own feature set into this application.

Thanks in advance!

d7eeem commented 4 years ago

Thank YOU very so much, this HomePage is amazing but i am having the same problem! :(