Skip to content

Instantly share code, notes, and snippets.

@jcromartie
Created September 21, 2012 02:32
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save jcromartie/da22fff78cdf344f6330 to your computer and use it in GitHub Desktop.
(defn parse-platform
[node]
(xml->map node
{:Name assoc-text
:OS (assoc-as :version text)
:Device (assoc-as :devices #(-> % text parse-list remove-empty))
:StoreRating (assoc-as :storeRating (comp parse-double text))
:StoreAggregate (assoc-as :storeAggregate (comp parse-double text))}))
(defn parse-app
[node]
(xml->map node
{:Name assoc-text
:Category (coalesce-into :categories text)
:Tag (coalesce-into :tags text)
:AppID assoc-text
:Short assoc-text
:Long assoc-text
:Published assoc-text
:ImageURL (assoc-as :image text)
:Language (coalesce-into :languages text)
:ImageScreen (coalesce-into :screenshots text)
:FriendlyURL assoc-text
:Organization assoc-text
:Platform (coalesce-into :platforms parse-platform)}))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment