annotate 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 |
rev |
line source |
adam@0
|
1 fun main () =
|
adam@1
|
2 Feed.app (Feed.children
|
adam@1
|
3 (Feed.tag "item" {1 = "rdf:about"})
|
adam@1
|
4 (Feed.tag "title" {}, Feed.tag "content:encoded" {}))
|
adam@1
|
5 (fn ({Attrs = {1 = about}, ...},
|
adam@1
|
6 ({Cdata = title, ...}, {Cdata = content, ...})) =>
|
adam@1
|
7 debug ("URL: " ^ about);
|
adam@1
|
8 (case title of
|
adam@1
|
9 None => return ()
|
adam@1
|
10 | Some title => debug ("Title: " ^ title));
|
adam@1
|
11 case content of
|
adam@1
|
12 None => return ()
|
adam@1
|
13 | Some content => debug ("Content: " ^ content))
|
adam@1
|
14 "http://feeds.feedburner.com/marginalrevolution/hCQh";
|
adam@0
|
15 return <xml>
|
adam@1
|
16 See stdout.
|
adam@0
|
17 </xml>
|