Permalink
Browse files

2018-01-08 report from opml

getting closer, though still not convenient
  • Loading branch information...
jflinchbaugh committed Jan 9, 2018
1 parent 57137e1 commit b270ad613be4454e5387ac10e4aa6b48a6b3a390
Showing with 34 additions and 10 deletions.
  1. +27 −10 2018-01.clj
  2. +7 −0 project.clj
View
@@ -1,26 +1,43 @@
(comment parse my opml file to print a summary)
(ns-aliases *ns*)
(keys (ns-aliases *ns*))
(ns-unalias *ns* 'zip)
(ns-unalias *ns* 'xml)
(ns-unalias *ns* 'io)
(require
'[clojure.java.io :as io]
'[clojure.data.xml :as xml]
'[clojure.xml :as xml]
'[clojure.java.io :as io]
'[clojure.zip :as zip]
'[clojure.data.zip.xml :as zip-xml]
)
(def opml (->
(def root (->
"data/BeyondPodFeeds.opml"
io/file
io/reader
xml/parse
zip/xml-zip
))
(->
opml
zip/down
zip/right
zip/children
pprint
(def feeds
(zip-xml/xml->
root
:body
:outline
:outline
zip/node
)
)
(pprint feeds)
(def report
(zipmap
(map #(-> % :attrs :text) feeds)
(map #(-> % :attrs :xmlUrl) feeds)
)
)
(pprint report)
View
@@ -0,0 +1,7 @@
(defproject com.hjsoft/clojure-scratch "1.0.0-SNAPSHOT"
:dependencies [
[org.clojure/clojure "1.9.0"]
[org.clojure/data.xml "0.0.8"]
[org.clojure/data.zip "0.1.1"]
]
)

0 comments on commit b270ad6

Please sign in to comment.