mi przychodzi na myśl: komponent tHttpGet i funkcja GetString nie geturl tylko get string, ona powinna zwrocic to co by sie wyswietlilo w przegladarce, reszta to twoja inicjatywa, ja prerabiałęm pogode z wp pl zeby ją sciagnac wyszlo calkiem niezle:
procedure Tpanel1.Timer1Timer(Sender: TObject);
var
str1,str2:string;
stemp,stemp2 : string;
tempstr:string;
s: tstrings;
begin
{
swiatlo.radius := swiatlo.radius/1.1;
if swiatlo.radius <= 0.0005 then
swiatlo.radius := 0.005; }
if WEATHER_CAN_BE_USED then
if WEATHER_DOWNLOADED then
if WEATHER_INITIALIZED then begin
timer1.Enabled:=false;exit;
end;
if WEATHER_DOWNLOADED then begin
synedit1.Lines.LoadFromFile(basedir+'LAST_WEATHER.HTML');
str1 := synedit1.Lines.Text;
WEATHER_INITIALIZED := true;
end;
if WEATHER_INITIALIZED then begin
s:=tstringlist.create;
//pobieramy nazwe obrazka obrazujacego pogode
str1 := usunwszystkoprzed(str1,'<div class="chmurka">');
str2 := extracturlfilename(get_text_between('<img src="','"',str1));
IMAGE_TO_WEATHER(str2,GLOBAL_WEATHER); //zamieniamy nazwe na wartosci logiczne
str1 := usunwszystkoprzed(str1,'<div class="opis">'); //pobieramy opis pogody
OPIS_POGODY := stringreplace(
get_text_between('"opis">','<br/>',lowercase(str1)),' ','',[rfreplaceall]);
//delete(opis_pogody,1,1);
//showmessage(OPIS_POGODY);
str1 := usunwszystkoprzed(str1,'<div class="temp">'); //pobieramy maksymalna i minimalna temperature
tempstr := get_text_between('<div class="temp">','</div>',lowercase(str1));
stemp := get_text_between('<strong>','</strong>',tempstr);
delete(stemp,pos('°',stemp),10);
stemp2 := tempstr;
delete(stemp2,1,pos('temp. min:',lowercase(stemp2)));
stemp2 := get_text_between('<strong>','</strong>',stemp2);
delete(stemp2,pos('°',stemp2),10);
GLOBAL_WEATHER.TEMP := pstrtofloat(stemp)/pstrtofloat(stemp2);
GLOBAL_WEATHER.TEMP_MAX := pstrtofloat(stemp);
GLOBAL_WEATHER.TEMP_MIN := pstrtofloat(stemp2);
GLOBAL_WEATHER.slonce_wschod[0] := 1; //pobieramy wartosci wiatru
tempstr := get_text_between('<div class="wiatr">','</div>',lowercase(str1));
OPIS_WIATRU := get_text_between('">','<br>',tempstr);
stemp := get_text_between('<strong>','</strong>',tempstr);
delete(stemp,pos(' ',stemp),10);
GLOBAL_WEATHER.wiatr_V := pstrtofloat(stemp); //moc wiatru (predkosc)
tempstr := get_text_between('<div class="slonce">','</div>',lowercase(str1));
stemp := get_text_between('<strong>','</strong>',tempstr);
stemp2 := stemp;
delete(stemp2,pos(':',stemp),10); //to daje nam godizne
delete(stemp,1,pos(':',stemp)); //a to minute
GLOBAL_WEATHER.slonce_wschod[0] := strtoint(stemp2);
GLOBAL_WEATHER.slonce_wschod[1] := strtoint(stemp);
delete(tempstr,1,pos('zach',lowercase(tempstr)));
stemp := get_text_between('>','<',tempstr);
stemp2 := stemp;
delete(stemp2,pos(':',stemp),10); //to daje nam godizne
delete(stemp,1,pos(':',stemp)); //a to minute
GLOBAL_WEATHER.slonce_zachod[0] := strtoint(stemp2);
GLOBAL_WEATHER.slonce_zachod[1] := strtoint(stemp);
s.add(OPIS_POGODY);
s.add(OPIS_WIATRU);
s.add('Slonce wschodzi o:' +inttostr(GLOBAL_WEATHER.slonce_wschod[0])+':'+inttostr(GLOBAL_WEATHER.slonce_wschod[1]));
s.add('Slonce zachodzi o:' +inttostr(GLOBAL_WEATHER.slonce_zachod[0])+':'+inttostr(GLOBAL_WEATHER.slonce_zachod[1]));
s.add('Predkosc wiatru: '+floattostr(GLOBAL_WEATHER.wiatr_V));
s.add('MAX TEMP: '+floattostr(GLOBAL_WEATHER.temp_max));
s.add('MIN TEMP: '+floattostr(GLOBAL_WEATHER.temp_min));
s.savetofile(basedir+'WEATHER_INFO.TXT');
//showmessage('Done');
//temp. max: <strong>11 °C</strong><br>temp. min: <strong>4 °C</strong>
CREATE_ATMOSPHERE(GLOBAL_WEATHER);
WEATHER_CAN_BE_USED :=true;
end;
end;