Created
March 17, 2013 16:03
-
-
Save co-dan/5182172 to your computer and use it in GitHub Desktop.
Using HXT to parse the OPML file you've exported from Google Reader
This file contains hidden or 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
import Text.XML.HXT.Core | |
doc = "/Users/dan/Downloads/greader-takeout/Reader/subscriptions.xml" | |
type Subscriptions = [(String, String)] | |
getSites :: ArrowXml a => a XmlTree (String,String) | |
getSites = isElem | |
>>> hasAttrValue "type" (=="rss") | |
>>> getAttrValue "htmlUrl" &&& getAttrValue "xmlUrl" | |
getSubscriptions :: IO Subscriptions | |
getSubscriptions = runX $ readDocument [] doc >>> deep getSites | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment