FCC weather Api icon issue

FCC weather Api icon issue
0.0 0

#1

Here’s my local weather app. Is anybody struggling to make icons from the FCC weather api show up? I had to fix a couple bug to get it working, but sometimes there would be no image and console log is telling me icon doesn’t exist. So I was wondering if FCC simply doesn’t have enough icons to cover the weather descriptions. I might think about introducing a new api just for the weather icons since the resolution is pretty low now, any suggestions?
Project Link - [https://codepen.io/zhoujr/pen/QOEERr?editors=1010]


#2

mebbe could store some unicode icons in a list?

http://www.codetable.net/groups

:sunny: :cloud: :open_umbrella:
etc…

check the groups…
http://www.codetable.net/Group/miscellaneous-symbols

http://www.codetable.net/Group/miscellaneous-symbols-and-pictographs

how they look in html…
https://codepen.io/Xiija/pen/KoamGK


#3

Hi ZoeZhoujr3h,

Looks like the weather api response just doesn’t include the icon property sometimes.

You can verify this by adding a console log a little earlier in your js code, ie., here:

$.get('https://fcc-weather-api.glitch.me/api/current?lat=' + latitude + '&lon=' +longitude, function(api){ 
    console.log(api)

A new api for the weather icons is a good idea.


#4

Thanks, I’ve checked it in the console log before and it confirms the api issue. I think instead of applying a new api for the weather icon, I might just add some custom icons based on temperatures.