|
|
@ -6,7 +6,7 @@
|
|
|
|
> be releasing on time~
|
|
|
|
> be releasing on time~
|
|
|
|
|
|
|
|
|
|
|
|
An utility to scrape italian weather websites to collect and compare weather
|
|
|
|
An utility to scrape italian weather websites to collect and compare weather
|
|
|
|
information
|
|
|
|
information for Pisa
|
|
|
|
|
|
|
|
|
|
|
|
## Usage
|
|
|
|
## Usage
|
|
|
|
|
|
|
|
|
|
|
@ -15,95 +15,31 @@ information
|
|
|
|
> complicated than it needs to be. You can remove unnecessary stuff if you're
|
|
|
|
> complicated than it needs to be. You can remove unnecessary stuff if you're
|
|
|
|
> not running this on nix
|
|
|
|
> not running this on nix
|
|
|
|
|
|
|
|
|
|
|
|
The scraper collects data and arranges in the following scheme
|
|
|
|
The script scrapes the weather forecast from the implemented sources (see the
|
|
|
|
|
|
|
|
table below) and returns an object with the following fields
|
|
|
|
|
|
|
|
|
|
|
|
```json
|
|
|
|
- **today:** an object with elements from the hour after the current one to
|
|
|
|
{
|
|
|
|
23, of type hourly (see below)
|
|
|
|
"today": {
|
|
|
|
- **tomorrow:** an object with elements from hours 0 to 23, of type hourly
|
|
|
|
"[0..23]": {
|
|
|
|
(see below)
|
|
|
|
"temperature": {
|
|
|
|
- **dayAfterTomorrow:** an object with elements from hours 0 to 23, of type
|
|
|
|
"type": "number",
|
|
|
|
hourly (see below)
|
|
|
|
"unitOfMeasurement": "degrees",
|
|
|
|
- **week:** an object with days 0 to 6, of type daily
|
|
|
|
"description": "expected temperature at the given hour"
|
|
|
|
- **format:** an object specifying the meaning of `hourly` and `daily` type
|
|
|
|
},
|
|
|
|
for the objects above
|
|
|
|
"precipitation": {
|
|
|
|
|
|
|
|
"type": "number",
|
|
|
|
The keys for `today`, `tomorrow` and `dayAfterTomorrow` are intended as hours
|
|
|
|
"unitOfMeasurement": "mm",
|
|
|
|
where `0` refers to the time from 0:00 to 0:59, and `23` refers to the time from
|
|
|
|
"description": "expected precipitation at the given hour"
|
|
|
|
23:00 to 23:59.
|
|
|
|
},
|
|
|
|
|
|
|
|
"weatherCode": {
|
|
|
|
|
|
|
|
"type": "string",
|
|
|
|
|
|
|
|
"description": "weather code (sunny / cloudy / ...)"
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
"tomorrow": {
|
|
|
|
|
|
|
|
"[0..23]": {
|
|
|
|
|
|
|
|
"temperature": {
|
|
|
|
|
|
|
|
"type": "number",
|
|
|
|
|
|
|
|
"unitOfMeasurement": "degrees",
|
|
|
|
|
|
|
|
"description": "expected temperature at the given hour"
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
"precipitation": {
|
|
|
|
|
|
|
|
"type": "number",
|
|
|
|
|
|
|
|
"unitOfMeasurement": "mm",
|
|
|
|
|
|
|
|
"description": "expected precipitation at the given hour"
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
"weatherCode": {
|
|
|
|
|
|
|
|
"type": "string",
|
|
|
|
|
|
|
|
"description": "weather code (sunny / cloudy / ...)"
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
"dayAfterTomorrow": {
|
|
|
|
|
|
|
|
"[0..23]": {
|
|
|
|
|
|
|
|
"temperature": {
|
|
|
|
|
|
|
|
"type": "number",
|
|
|
|
|
|
|
|
"unitOfMeasurement": "degrees",
|
|
|
|
|
|
|
|
"description": "expected temperature at the given hour"
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
"precipitation": {
|
|
|
|
|
|
|
|
"type": "number",
|
|
|
|
|
|
|
|
"unitOfMeasurement": "mm",
|
|
|
|
|
|
|
|
"description": "expected precipitation at the given hour"
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
"weatherCode": {
|
|
|
|
|
|
|
|
"type": "string",
|
|
|
|
|
|
|
|
"description": "weather code (sunny / cloudy / ...)"
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
"week": {
|
|
|
|
|
|
|
|
"[0..6]": {
|
|
|
|
|
|
|
|
"minimumTemperature": {
|
|
|
|
|
|
|
|
"type": "number",
|
|
|
|
|
|
|
|
"unitOfMeasurement": "degrees",
|
|
|
|
|
|
|
|
"description": "minimum expected temperature for the day"
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
"maximumTemperature": {
|
|
|
|
|
|
|
|
"type": "number",
|
|
|
|
|
|
|
|
"unitOfMeasurement": "degrees",
|
|
|
|
|
|
|
|
"description": "maximum expected temperature for the day"
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
"precipitationSum": {
|
|
|
|
|
|
|
|
"type": "number",
|
|
|
|
|
|
|
|
"unitOfMeasurement": "mm",
|
|
|
|
|
|
|
|
"description": "total expected precipitation for the day"
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
"weatherCode": {
|
|
|
|
|
|
|
|
"type": "string",
|
|
|
|
|
|
|
|
"description": "weather code (sunny / cloudy / ...)"
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The keys for the `week` entry are intended as an offset from today. That is, the
|
|
|
|
The keys for the `week` entry are intended as an offset from today. That is, the
|
|
|
|
object at `0` will be the results for today, the object at `1` will be the
|
|
|
|
object at `0` will be the results for today, the object at `1` will be the
|
|
|
|
results for tomorrow, and the object at `6` will be the results for 6 days from
|
|
|
|
results for tomorrow, and the object at `6` will be the results for 6 days from
|
|
|
|
now
|
|
|
|
now
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Each source has its own format and they are specified below in the sources
|
|
|
|
|
|
|
|
section (as well as in the object returned by the scraper)
|
|
|
|
|
|
|
|
|
|
|
|
### Sources
|
|
|
|
### Sources
|
|
|
|
|
|
|
|
|
|
|
|
These are the sources that are currently implemented or will be implemented
|
|
|
|
These are the sources that are currently implemented or will be implemented
|
|
|
@ -117,7 +53,162 @@ eventually, together with the current level of implementation
|
|
|
|
|
|
|
|
|
|
|
|
| Source | Status | Comments |
|
|
|
|
| Source | Status | Comments |
|
|
|
|
| ---------------------------------------------------- | ------ | ---------------------------------------- |
|
|
|
|
| ---------------------------------------------------- | ------ | ---------------------------------------- |
|
|
|
|
| [iLMeteo](https://www.ilmeteo.it) | 🚧 | Weather Code not working |
|
|
|
|
| [iLMeteo](https://www.ilmeteo.it) | ✅ | |
|
|
|
|
| [3Bmeteo](https://www.3bmeteo.com/) | 🚧 | Precipitation might not work as intended |
|
|
|
|
| [3Bmeteo](https://www.3bmeteo.com/) | 🚧 | Precipitation might not work as intended |
|
|
|
|
| [OpenMeteo](https://open-meteo.com/) | 🚧 | Weather Code are given in WMO Code |
|
|
|
|
| [OpenMeteo](https://open-meteo.com/) | ✅ | |
|
|
|
|
| [Meteo Aeronautica Militare](http://www.meteoam.it/) | ⛔️ | |
|
|
|
|
| [Meteo Aeronautica Militare](http://www.meteoam.it/) | ⛔️ | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<details>
|
|
|
|
|
|
|
|
<summary>iLMeteo</summary>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Format:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```json
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
"hourly": {
|
|
|
|
|
|
|
|
"temperature": {
|
|
|
|
|
|
|
|
"type": "number",
|
|
|
|
|
|
|
|
"unit": "°C"
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
"precipitation": {
|
|
|
|
|
|
|
|
"type": "number",
|
|
|
|
|
|
|
|
"unit": "mm"
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
"apparentTemperature": {
|
|
|
|
|
|
|
|
"type": "number",
|
|
|
|
|
|
|
|
"unit": "°C"
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
"daily": {
|
|
|
|
|
|
|
|
"minimumTemperature": {
|
|
|
|
|
|
|
|
"type": "number",
|
|
|
|
|
|
|
|
"unit": "°C"
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
"maximumTemperature": {
|
|
|
|
|
|
|
|
"type": "number",
|
|
|
|
|
|
|
|
"unit": "°C"
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
"minimumApparentTemperature": {
|
|
|
|
|
|
|
|
"type": "number",
|
|
|
|
|
|
|
|
"unit": "°C"
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
"maximumApparentTemperature": {
|
|
|
|
|
|
|
|
"type": "number",
|
|
|
|
|
|
|
|
"unit": "°C"
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
"precipitationSum": {
|
|
|
|
|
|
|
|
"type": "number",
|
|
|
|
|
|
|
|
"unit": "mm"
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</details>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<details>
|
|
|
|
|
|
|
|
<summary>3Bmeteo</summary>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Format:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```json
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
"hourly": {
|
|
|
|
|
|
|
|
"temperature": {
|
|
|
|
|
|
|
|
"type": "number",
|
|
|
|
|
|
|
|
"unit": "°C"
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
"precipitation": {
|
|
|
|
|
|
|
|
"type": "number",
|
|
|
|
|
|
|
|
"unit": "mm"
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
"apparentTemperature": {
|
|
|
|
|
|
|
|
"type": "number",
|
|
|
|
|
|
|
|
"unit": "°C"
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
"weatherCode": {
|
|
|
|
|
|
|
|
"type": "string"
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
"daily": {
|
|
|
|
|
|
|
|
"minimumTemperature": {
|
|
|
|
|
|
|
|
"type": "number",
|
|
|
|
|
|
|
|
"unit": "°C"
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
"maximumTemperature": {
|
|
|
|
|
|
|
|
"type": "number",
|
|
|
|
|
|
|
|
"unit": "°C"
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
"minimumApparentTemperature": {
|
|
|
|
|
|
|
|
"type": "number",
|
|
|
|
|
|
|
|
"unit": "°C"
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
"maximumApparentTemperature": {
|
|
|
|
|
|
|
|
"type": "number",
|
|
|
|
|
|
|
|
"unit": "°C"
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
"precipitationSum": {
|
|
|
|
|
|
|
|
"type": "number",
|
|
|
|
|
|
|
|
"unit": "mm"
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</details>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<details>
|
|
|
|
|
|
|
|
<summary>OpenMeteo</summary>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Format:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```json
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
"hourly": {
|
|
|
|
|
|
|
|
"temperature": {
|
|
|
|
|
|
|
|
"type": "number",
|
|
|
|
|
|
|
|
"unit": "°C"
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
"precipitation": {
|
|
|
|
|
|
|
|
"type": "number",
|
|
|
|
|
|
|
|
"unit": "mm"
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
"apparentTemperature": {
|
|
|
|
|
|
|
|
"type": "number",
|
|
|
|
|
|
|
|
"unit": "°C"
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
"weatherCode": {
|
|
|
|
|
|
|
|
"type": "number",
|
|
|
|
|
|
|
|
"unit": "WMO code"
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
"daily": {
|
|
|
|
|
|
|
|
"minimumTemperature": {
|
|
|
|
|
|
|
|
"type": "number",
|
|
|
|
|
|
|
|
"unit": "°C"
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
"maximumTemperature": {
|
|
|
|
|
|
|
|
"type": "number",
|
|
|
|
|
|
|
|
"unit": "°C"
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
"minimumApparentTemperature": {
|
|
|
|
|
|
|
|
"type": "number",
|
|
|
|
|
|
|
|
"unit": "°C"
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
"maximumApparentTemperature": {
|
|
|
|
|
|
|
|
"type": "number",
|
|
|
|
|
|
|
|
"unit": "°C"
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
"precipitationSum": {
|
|
|
|
|
|
|
|
"type": "number",
|
|
|
|
|
|
|
|
"unit": "mm"
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
"weatherCode": {
|
|
|
|
|
|
|
|
"type": "number",
|
|
|
|
|
|
|
|
"unit": "WMO code"
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</details>
|
|
|
|