function [ CC ] = CC_generaTemperature( CC )

base = 0;
date = floor(CC.inizioNum):datenum(0,0,1,0,0,0):ceil(CC.fineNum)-datenum(0,0,0,0,1,0);
for h = 1:length(date)
    [anno mese giorno dummy1 dummy2 dummy3] = datevec(date(h));
    fprintf('Requesting %d/%d/%d of %s ... ',giorno,mese,anno,CC.id)
    req = sprintf('http://www.wunderground.com/weatherstation/WXDailyHistory.asp?ID=%s&month=%d&day=%d&year=%d&format=1',CC.id,mese,giorno,anno);
    data = urlread(req);
    fprintf('%d bytes received ... ',length(data))
    data = strrep(data,[char(10),'<br>'],'');
    data_capo = strfind(data,char(10));
    data = data(data_capo(3):(data_capo(end-1)));
    ix = strfind(data,char(10));

    for k = 1:length(ix)-1
        day = datenum(data(ix(k):(ix(k)+19)),'yyyy-mm-dd HH:MM:SS');
        temp = (5/9)*( str2num(data(ix(k)+21:(ix(k)+24))) - 32 );
        misure(k+base,:) = [day temp];
    end
    
    base = base + k;

    fprintf('%d sample processed (%d total)\n',k,base)
end
fprintf('MAX DISCONTINUITY: %s\n',datestr(max(gradient(misure(:,1))),13))

%%
tempi = CC.inizioNum:CC.dt:CC.fineNum;
CC.T = single(interp1(misure(:,1),misure(:,2),tempi,'spline'));

if CC.show == 1
    %%
    figure(100)
    plot(gradient(misure(:,1)))
    title('Differenza tra gli istanti di campionamento da web')
    figure(101)    
    title('Temperatura rilevata da web')
    plot(tempi,CC.T,'g',misure(:,1),misure(:,2),'r+')    
end
