<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>utils/dump.txt</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -8,8 +8,45 @@ SUB_COMMANDS = %w/feed post add new/
 
 raise ArgumentError, &quot;Sin comando&quot; unless ARGV[0]
 
+# parse_opml (opml_node, parent_names=[])
+#
+# takes an REXML::Element that has OPML outline nodes as children, 
+# parses its subtree recursively and returns a hash:
+# { feed_url =&gt; [parent_name_1, parent_name_2, ...] } 
+#
+def parse_opml(opml_node, parent_names=[])
+  feeds = {}
+  opml_node.elements.each('outline') do |el|
+    if (el.elements.size != 0) 
+      feeds.merge!(parse_opml(el, parent_names + [el.attributes['text']]))
+    end
+    if (el.attributes['xmlUrl'])
+      feeds[el.attributes['xmlUrl']] = parent_names
+    end
+  end
+  return feeds
+end
+
+
 cmd = ARGV.shift
 case cmd
+  when &quot;opml&quot;
+    require 'rexml/Document'
+
+    opml = REXML::Document.new(File.read(ARGV[0]))
+    feeds = parse_opml(opml.elements['opml/body'])
+    feeds.keys.each do |f|
+      puts &quot;#{f}:&quot;
+      feed = Feed.new :url =&gt; f
+      if feed.save
+        puts &quot; success!&quot;
+      else
+        puts &quot; errors:&quot;
+        puts feed.errors.full_messages
+        puts
+      end
+    end
+     
 	when &quot;update&quot;
 		if ARGV[0]
 			fs = Feed.find ARGV[0]</diff>
      <filename>bin/rfeed</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>cf4ae6fa5f4e13cada07c6464db79e0b2fbb00ee</id>
    </parent>
  </parents>
  <author>
    <name>David Moreno</name>
    <email>david@axiombox.com</email>
  </author>
  <url>http://github.com/damog/rfeed/commit/df0f0229d1dd2d4c8e3d8a291f67f54ffa926ee3</url>
  <id>df0f0229d1dd2d4c8e3d8a291f67f54ffa926ee3</id>
  <committed-date>2009-02-10T15:03:11-08:00</committed-date>
  <authored-date>2009-02-10T15:03:11-08:00</authored-date>
  <message>agrego opml</message>
  <tree>ea09e778f50c545daf62e97bb01d9ac91ad2d7b1</tree>
  <committer>
    <name>David Moreno</name>
    <email>david@axiombox.com</email>
  </committer>
</commit>
