La verdad es que la función pretendía ser mas de lo que al final fue
"Parseaba" la fecha, la hora, la estación, etc ... pero si lo único que quieres es la temperatura no hace falta tanta tontería. Aquí te dejo la versión recortada:
Código Delphi
[-]
function Temperatura(Estacion: String): Integer;
begin
Result:= MAXINT;
with TStringList.Create do
try
DelimitedText:= Bajar(Format(
'ftp://tgftp.nws.noaa.gov/data/observations/metar/stations/%s.TXT',
[Estacion]));
Delete(0);
Delete(0);
if Count > 0 then
begin
while (pos('/',Strings[0]) = 0) do
begin
Delete(0);
if Count = 0 then
exit;
end;
Result:= GetNum(Strings[0]);
end;
finally
Free;
end;
end;