台灣中央氣象局 (CWB) 的非官方 open data library
<dependency>
<groupId>tw.kewang</groupId>
<artifactId>cwb</artifactId>
<version>0.2.0</version>
</dependency>
compile 'tw.kewang:cwb:0.2.0'
At first, you must add api key.
Cwb cwb = Cwb.getInstance().init(System.getenv("CWB_APIKEY"));
FutureWeatherByTown weather1 = cwb.getFutureWeatherByTown("新莊區", 2);
System.out.println(weather1.getDescription().getStartDate());
System.out.println(weather1.getDescription().getEndDate());
System.out.println(weather1.getDescription().getDetail());
System.out.println(weather1.getDescription().getShort());
System.out.println(weather1.getComfortable().getDataDate());
System.out.println(weather1.getComfortable().getString());
System.out.println(weather1.getComfortable().getValue());
System.out.println(weather1.getApparent());
System.out.println(weather1.getTemperature());
System.out.println(weather1.getPoP());
System.out.println(weather1.getRH());
System.out.println(weather1.getWind().getDataDate());
System.out.println(weather1.getWind().getDirectionDetail());
System.out.println(weather1.getWind().getDirectionShort());
System.out.println(weather1.getWind().getScale());
System.out.println(weather1.getWind().getSpeed());