Created
December 9, 2015 11:36
-
-
Save garyposter/6ea97be64e824cbc98a0 to your computer and use it in GitHub Desktop.
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
body | |
|> xpath(~x"//current_observation/*"l, # Get a list of the child nodes. | |
tag: ~x"name()", # Get the tag name for each. | |
value: ~x"./text()"s) # Get the text for each. | |
|> Enum.map(fn(%{tag: tag, value: value}) -> {List.to_atom(tag), value} end) | |
|> Enum.into(Map.new) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment