Skip to content

kewang/cwb-lib-java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cwb-lib-java

台灣中央氣象局 (CWB) 的非官方 open data library

Build Status Maven Central

Dependency

Maven

<dependency>
  <groupId>tw.kewang</groupId>
  <artifactId>cwb</artifactId>
  <version>0.2.0</version>
</dependency>

Gradle

compile 'tw.kewang:cwb:0.2.0'

How to use

At first, you must add api key.

Cwb cwb = Cwb.getInstance().init(System.getenv("CWB_APIKEY"));

Get Future Weather By Town

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());

About

台灣中央氣象局 (CWB) 的非官方 open data library

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages