See: Description
Interface | Description |
---|---|
YWeatherEntryModule |
An interface describing the entry/item level data for Yahoo Weather.
|
YWeatherFeedModule |
An interface describing feed/channel level data for Yahoo Weather.
|
YWeatherModule |
A simple parent interface that defines the feed URI.
|
YWeatherModuleImpl.CopyFromInterface |
Inteface combining feed and entry module.
|
Class | Description |
---|---|
YWeatherModuleImpl |
A Module implementation for entry or feed level information.
|
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);
Copyright © 2021. All rights reserved.