@@ -0,0 +1,2942 @@
+/*%0A * To change this license header, choose License Headers in Project Properties.%0A * To change this template file, choose Tools %7C Templates%0A * and open the template in the editor.%0A */%0Apackage narvis.module.meteo;%0A%0A%0Aimport java.io.IOException;%0Aimport java.net.MalformedURLException;%0Aimport net.aksingh.owmjapis.CurrentWeather;%0Aimport net.aksingh.owmjapis.OpenWeatherMap;%0Aimport org.json.JSONException;%0Aimport sun.management.MemoryUsageCompositeData;%0A%0A%0A/**%0A *%0A * @author Puma%0A */%0Apublic class OwPortal %7B%0A    %0A    private final CurrentWeather _currentWeather;%0A    %0A    public OwPortal(String city) throws IOException, JSONException%0A    %7B%0A%09%09/*01b5f54b9605d5bbae6cf9f831560fb5 : my Api key*/%0A        OpenWeatherMap owm = new OpenWeatherMap(%2201b5f54b9605d5bbae6cf9f831560fb5%22);%0A        %0A%09%09/*Warning : The weather API could mistake the given city with another.*/%0A%09%09/*For example : London, if you just put london : The result will be....*/%0A%09%09/*....*/%0A%09%09/*drum roll*/%0A%09%09/*....*/%0A%09%09/*The LONDON from CANADA !!! */%0A%09%09/* which is not the London from UK ! Greets from Captain Obvious*/%0A        this._currentWeather = owm.currentWeatherByCityName(city);%0A        %0A    %7D%0A%0A    public double getCountry()%0A    %7B%0A        return this._currentWeather.getCityCode();%0A    %7D%0A    %0A    public double getMaxTemperatureInFarenheit()%0A    %7B%0A        return this._currentWeather.getMainInstance().getMaxTemperature();%0A    %7D%0A    %0A    public double getMaxTemperatureInCelsius()%0A    %7B%0A        %0A        double farenheitTemperature = getMaxTemperatureInFarenheit();%0A        return (farenheitTemperature  -  32.0) *5.0/9.0;%0A    %7D%0A %0A    public double getWindSpeed() throws NoSuchFieldException%0A    %7B%0A        if( this._currentWeather.getWindInstance().hasWindSpeed() )%0A            return this._currentWeather.getWindInstance().getWindSpeed();%0A        %0A        throw new NoSuchFieldException(%22No wind speed found%22);%0A    %7D%0A    %0A    %0A    public double getPercentageOfCloud() throws NoSuchFieldException%0A    %7B%0A        if( this._currentWeather.getCloudsInstance().hasPercentageOfClouds() )%0A            return this._currentWeather.getCloudsInstance().getPercentageOfClouds();%0A        %0A        throw new NoSuchFieldException(%22No cloud percentage found%22);%0A    %7D%0A    %0A    %0A    /***%0A     * Quick and rough way to know if the weather is good or not%0A     * @return %0A     */%0A    public boolean isSkyClear()%0A    %7B%0A       double pressure = this._currentWeather.getMainInstance().getPressure();%0A       %0A       if( pressure %3E 1010)%0A           return true;%0A       else %0A           return false;%0A    %7D%0A%09%0A%09%0A%09    %0A    public static void main(String%5B%5D args)throws IOException, MalformedURLException, JSONException %0A    %7B%0A        OwPortal p = new OwPortal(%22London%22);%0A        %0A        System.out.print(p.getCountry());%0A        System.out.println(p.getMaxTemperatureInCelsius());%0A        System.out.println(p.getMaxTemperatureInFarenheit());%0A        System.out.println(p.isSkyClear());%0A    %0A    %7D%0A%09%0A%09%0A%09%0A%09%0A%7D%0A

Add comments to code