-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOpenMetro.cpp
More file actions
30 lines (23 loc) · 794 Bytes
/
OpenMetro.cpp
File metadata and controls
30 lines (23 loc) · 794 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include "OpenMetro.h"
namespace OpenMetro {
CityResponse::CityResponse() {
name = "";
country = "";
admin1 = "";
latitude = 0;
longitude = 0;
};
String Request::getCityURL(String name, int8_t count) {
String countStr = String(count);
return "https://geocoding-api.open-meteo.com/v1/search?name=" + name + "&count=" + countStr + format + language;
};
String Request::getCityURL(String name) {
return Request::getCityURL(name, 1);
};
String Request::getWeatherURL(float latitude, float longitude) {
String latitudeStr = String(latitude);
String longitudeStr = String(longitude);
return "https://api.open-meteo.com/v1/forecast?latitude=" + latitudeStr + "&longitude=" +
longitudeStr + "¤t_weather=true" + format + language;
};
} // namespace OpenMetro