Download Jar. Libraryless. Click here for Pure Java version (5918L/40K).
1 | !7 |
2 | |
3 | p {
|
4 | S url = "http://api.openweathermap.org/data/2.5/forecast"; |
5 | S xml = /*postPage*/loadPageWithParams(url, APPID := openWeatherMapAPIKey(), q := "Hamburg", mode := "xml"); |
6 | print(xml); |
7 | new TreeMap<S, Double> maxPerDay; |
8 | for (L<S> tTime : findContainerOrEmptyTag(xml, "time")) {
|
9 | S from = tagParam(tTime, "from"); |
10 | S day = takeFirst(from, lastIndexOf(from, "T")); |
11 | L<S> tTemperature = first(findContainerOrEmptyTag(tTime, "temperature")); |
12 | double maxTemp = kelvinToCelsius(parseDouble(tagParam(tTemperature, "max"))); |
13 | maxPerDay.put(day, max(maxTemp, toDouble(maxPerDay.get(day)))); |
14 | } |
15 | pnlStruct(maxPerDay); |
16 | } |
download show line numbers debug dex old transpilations
Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt, xfbsdwenvhih
No comments. add comment
| Snippet ID: | #1013965 |
| Snippet name: | Test OpenWeatherMap Forecast |
| Eternal ID of this version: | #1013965/9 |
| Text MD5: | f0a2a4a54e8e3349df9f9b2537c5d6e5 |
| Transpilation MD5: | 1c4e87e9e100c2fd5952054cfcb51b60 |
| Author: | stefan |
| Category: | javax / networking |
| Type: | JavaX source code (desktop) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2018-03-18 19:23:20 |
| Source code size: | 653 bytes / 16 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 768 / 1752 |
| Version history: | 8 change(s) |
| Referenced in: | [show references] |