123456789101112131415161718192021222324252627282930313233 |
- PVector v2_coordinates = new PVector(48.799337, 9.794482); //badmauer; x: latitude, y: longitude
-
- boolean b_isRaining;
-
- void initWeather(){
-
-
-
- //sunrise / sunset API: https://sunrise-sunset.org/api
- JSONObject sun;
- if(b_loadSun) sun = loadJSONObject("https://api.sunrise-sunset.org/json?lat=" + v2_coordinates.x + " &lng=" + v2_coordinates.y);
- else sun = loadJSONObject(dataPath("weather/today.json"));
- println(sun);
-
- }
-
- /* backup json today (if api has yet to encounter limits)
- {
- "results": {
- "sunrise": "7:13:29 AM",
- "solar_noon": "11:25:52 AM",
- "day_length": "08:24:45",
- "astronomical_twilight_end": "5:33:03 PM",
- "astronomical_twilight_begin": "5:18:41 AM",
- "sunset": "3:38:14 PM",
- "civil_twilight_end": "4:14:48 PM",
- "nautical_twilight_end": "4:54:50 PM",
- "civil_twilight_begin": "6:36:55 AM",
- "nautical_twilight_begin": "5:56:54 AM"
- },
- "status": "OK"
- }
- */
|