Skip navigation links

Package com.rometools.modules.yahooweather

This package contains Modules for working with Yahoo! Weather.

See: Description

Package com.rometools.modules.yahooweather Description

This package contains Modules for working with Yahoo! Weather.

Example usage:

Retrieving information from a feed:

          SyndFeed feed = input.build( ... );
          YWeatherFeedModule yfeed = (YWeatherFeedModule) feed.getModule( YWeatherFeedModule.URI );
          System.out.println( yfeed.getLocation().getCity() );
          SyndEntry entry = (SyndEntry) feed.getEntries().get(0);
          YWeatherEntryModule yentry = (YWeatherEntryModule) entry.getModule( YWeatherEntryModule.URI );
          System.out.println( yentry.getForecasts()[0].getHigh();
      

To add information to a feed, construct a YWeatherModuleImpl and cast it to the appropriate interface:

          SyndEntry entry = new SyndEntryImpl();
          YWeatherEntryModule yentry = new YWeatherModuleImpl();
          yentry.setCondition( Condition("Partly Cloudy", ConditionCode.PARTLY_CLOUDY, 65, new Date() ) );
          entry.getModules.add(yentry);
        
Skip navigation links

Copyright © 2021. All rights reserved.