class WeatherWebApi {

    public List<WeatherInfo> pastWeather(double lat, double log, LocalDate from, LocalDate to) {
        String path = HOST + String.format(PATH_PAST_WEATHER, lat, log, from, to, WEATHER_KEY);
        List<WeatherInfo> infos = new ArrayList<>();
        try(
            InputStream in = new URL(path).openStream();
            BufferedReader reader = new BufferedReader(new InputStreamReader(in)))
        {
            String line;
            while (reader.readLine().startsWith("#")) { } // Skip comments
            reader.readLine();                            // Skip Not Available
            while ((line = reader.readLine()) != null) {
                infos.add(WeatherInfo.valueOf(line));
                reader.readLine();                        // Skip daily information
            }
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
        return infos;
    }

}