forked from shaper/yahoo-weather
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- upped library to version 1.2.0 to reflect changes. - use new Yahoo Weather API url at http://weather.yahooapis.com/forecastrss - shift xml parsing to use nokogiri rather than xml-simple. - shift from Response.image_url to Response.image which contains the new YahooWeather::Image record with the old image url plus more detail as now provided in the API response.
- Loading branch information
Walter Korman
committed
Dec 25, 2009
1 parent
3d2b9ad
commit 8eb3560
Showing
10 changed files
with
88 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
class YahooWeather::Image | ||
# the height of the image in pixels. | ||
attr_reader :height | ||
|
||
# the url intended to be used as a link wrapping the image, for | ||
# instance, to send the user to the main Yahoo Weather home page. | ||
attr_reader :link | ||
|
||
# the title of hte image. | ||
attr_reader :title | ||
|
||
# the full url to the image. | ||
attr_reader :url | ||
|
||
# the width of the image in pixels. | ||
attr_reader :width | ||
|
||
def initialize (payload) | ||
@title = payload.xpath('title').first.content | ||
@link = payload.xpath('link').first.content | ||
@url = payload.xpath('url').first.content | ||
@height = payload.xpath('height').first.content.to_i | ||
@width = payload.xpath('width').first.content.to_i | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters