view tests/mr.ur @ 1:8de269c09617

Outputting a summary of Marginal Revolution RSS feed
author Adam Chlipala <adam@chlipala.net>
date Tue, 11 Jan 2011 13:17:44 -0500
parents ad85b8813e8a
children ea0ca570c121
line wrap: on
line source
fun main () =
    Feed.app (Feed.children
                  (Feed.tag "item" {1 = "rdf:about"})
                  (Feed.tag "title" {}, Feed.tag "content:encoded" {}))
             (fn ({Attrs = {1 = about}, ...},
                  ({Cdata = title, ...}, {Cdata = content, ...})) =>
                 debug ("URL: " ^ about);
                 (case title of
                      None => return ()
                    | Some title => debug ("Title: " ^ title));
                  case content of
                      None => return ()
                    | Some content => debug ("Content: " ^ content))
             "http://feeds.feedburner.com/marginalrevolution/hCQh";
    return <xml>
      See stdout.
    </xml>