Use skycon with forecast.io

If you want to use the skycons icons with forecast.io then the following code will fit your needs.

First inlcude the skycons.js in your page.

Lets say the response of forecast.io is stored in var res

// res is the Response of forecast.io

var icon = new window.Skycons({
    color: '#4b2332'
});
var skycon = res.currently.icon.toUpperCase().replace(/\-/g, '_');

icon.set($icon.attr('id'), window.Skycons[skycon]);
icon.play();

// f2c is a converter of fahrenheit to celsius
$('#weather').html(res.currently.summary + ' ' + f2c(res.currently.temperature)°C');

PS. the function f2c can be found here.