GitXplorerGitXplorer
g

davethomas-elixir-chapter13-weathernow

public
0 stars
0 forks
0 issues

Commits

List of commits on branch master.
Unverified
8a77eeb472236556627b2f09bf8cef18a141e7fb

add license, for good hygiene.

ggaryposter committed 9 years ago
Unverified
43be82e6f0f5331963597f4ca983e6eb7ecc246c

begin the README

ggaryposter committed 9 years ago
Unverified
b60bdfda3e0e6a5b53993224334588aaa08660a3

convert to using Error monad

ggaryposter committed 9 years ago
Unverified
db04b6591854955983a5533954297632c7615f3c

experiment with using erlsom instead of SweetXml/xpath.

ggaryposter committed 9 years ago
Unverified
dd347e8fb62645a84525ef8f34daa31c412c24aa

add some minimal tests to support refactoring the parsing

ggaryposter committed 9 years ago
Unverified
9691a37e0ab1579c9d59de0df60bb7bd3bc2f856

add some test data

ggaryposter committed 9 years ago

README

The README file for this repository.

Weathernow

Following on the amazing hit of my version of the CLI app from chapter 13 of Dave Thomas' Programming Elixir, this is a rough implementation of the second exercise at the end of the chapter.

The CLI accepts one or more airport codes, and returns the current weather from the NOAA observation files.

$ ./weathernow RDU SFO
Raleigh / Durham, Raleigh-Durham International Airport, NC (35.89223, -78.78185)
Last Updated on Dec 8 2015, 7:51 am EST
Weather            ┃ Patches Fog   
Temperature        ┃ 37.0 F (2.8 C)
Relative Humidity  ┃ 96            
Wind               ┃ Calm          
Pressure           ┃ 1021.5 mb     
Dewpoint           ┃ 36.0 F (2.2 C)
Visibility (miles) ┃ 10.00         

San Francisco, San Francisco International Airport, CA (37.61961, -122.36558)
Last Updated on Dec 8 2015, 4:56 am PST
Weather            ┃ Fog            
Temperature        ┃ 54.0 F (12.2 C)
Relative Humidity  ┃ 93             
Wind               ┃ Calm           
Pressure           ┃ 1024.0 mb      
Dewpoint           ┃ 52.0 F (11.1 C)
Visibility (miles) ┃ 0.50           

I've explored a few things in the course of this implementation: the Erlang erlsom library, the Elixir support for Erlang records (needed to use the erlsom library), and the Error monad. I might still explore the dependency injection approach to testing that José Valim advocates but since this is just an exercise, I might push that to another project.