Examples of YahooWeatherService


Examples of com.googlecode.mashups.services.yahoo.api.YahooWeatherService

            ResponseWriter         writer              = context.getResponseWriter();       
            YahooWeather           yahooWeather        = (YahooWeather) component;
            String                 locationCode        = yahooWeather.getLocationCode();
            String                 temperatureType     = yahooWeather.getTemperatureType();
            List<ServiceParameter> parameters          = new ArrayList<ServiceParameter>();
            YahooWeatherService    yahooWeatherService = YahooServicesFactory.getYahooWeatherService();
           
            parameters.add(new ServiceParameter(YahooWeatherServiceParameters.ZIP_CODE, locationCode));
            parameters.add(new ServiceParameter(YahooWeatherServiceParameters.TEMPERATURE_TYPE, temperatureType));
           
            try {
                YahooWeatherServiceStatus status = yahooWeatherService.getWeatherStatus(parameters);
                
                writer.write(status.toString());
            } catch (InvalidLocationException exception) {
                writer.write("");               
            } catch (Exception exception) {
View Full Code Here

Examples of com.googlecode.mashups.services.yahoo.api.YahooWeatherService

        List<ServiceParameter> weatherStatusParameters = new ArrayList<ServiceParameter>();
       
        weatherStatusParameters.add(new ServiceParameter(YahooWeatherServiceParameters.ZIP_CODE, "94089"));
        weatherStatusParameters.add(new ServiceParameter(YahooWeatherServiceParameters.TEMPERATURE_TYPE, "c"));
       
        YahooWeatherService yahooWeatherService = YahooServicesFactory.getYahooWeatherService();
       
        try {
            YahooWeatherServiceStatus status = yahooWeatherService.getWeatherStatus(weatherStatusParameters);
           
            System.out.println("Output: \n\r" + status);
        } catch (Exception e) {
            e.printStackTrace();
            fail("Unable to get the weather status ...");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.