<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,3 +1,2 @@
 TODO:
-- Add categories to rss2 feeds
 - Add categories to atom feeds</diff>
      <filename>TODO</filename>
    </modified>
    <modified>
      <diff>@@ -95,9 +95,13 @@ class FeedMe::AbstractParser
   end
 
   def fetch(selector, search_in = xml, method = :inner_html)
-    item = search_in.at(selector)
+    item = search_in.search(selector)
 
-    self.try(&quot;extract_&quot; + method.to_s, item) if item
+    unless method == :array
+      self.try(&quot;extract_&quot; + method.to_s, item.first) unless item.empty?
+    else
+      item.map { |i| self.try(&quot;extract_inner_html&quot;, i) }
+    end
   end
 
   def extract_inner_html(item)</diff>
      <filename>lib/feed_me/abstract_parser.rb</filename>
    </modified>
    <modified>
      <diff>@@ -53,7 +53,8 @@ module FeedMe
       :item_id =&gt; :guid,
       :url =&gt; :link,
       :content =&gt; :description,
-      :author =&gt; :special
+      :author =&gt; :special,
+      :categories =&gt; [:category, :array]
     }
   }
 </diff>
      <filename>lib/feed_me/consts.rb</filename>
    </modified>
    <modified>
      <diff>@@ -18,7 +18,9 @@
 			&lt;author&gt;da_man@example.com (Chuck Norris)&lt;/author&gt;
 			&lt;description&gt;This is content&lt;/description&gt;
 			&lt;pubDate&gt;Tue, 03 Jun 2003 09:39:21 GMT&lt;/pubDate&gt;
-			&lt;guid&gt;http://liftoff.msfc.nasa.gov/2003/06/03.html#item573&lt;/guid&gt;
+            &lt;guid&gt;http://liftoff.msfc.nasa.gov/2003/06/03.html#item573&lt;/guid&gt;
+            &lt;category&gt;news&lt;/category&gt;
+            &lt;category&gt;chuck&lt;/category&gt;
 		&lt;/item&gt;
 		&lt;item&gt;
 			&lt;title&gt;Space Exploration&lt;/title&gt;</diff>
      <filename>spec/fixtures/welformed.rss2</filename>
    </modified>
    <modified>
      <diff>@@ -77,6 +77,12 @@ describe FeedMe::ItemParser do
     end
   end
 
+  describe '#categories' do
+    it &quot;should be correct for an rss2 feed&quot; do
+      @rss2.categories.should == ['news', 'chuck']
+    end
+  end
+
   describe '#author.name' do
     it &quot;should be valid for an atom feed&quot; do
       @atom.author.name.should == &quot;Jonas Nicklas&quot;</diff>
      <filename>spec/item_parser_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>ea6e1cdff477e7083f4bf2237006ff0f7111df15</id>
    </parent>
  </parents>
  <author>
    <name>Jonathan Stott</name>
    <email>jonathan.stott@gmail.com</email>
  </author>
  <url>http://github.com/jnicklas/feed_me/commit/aef2f349a54cf6457f235da52335c0e6c9199050</url>
  <id>aef2f349a54cf6457f235da52335c0e6c9199050</id>
  <committed-date>2009-03-21T12:56:55-07:00</committed-date>
  <authored-date>2009-03-21T12:56:55-07:00</authored-date>
  <message>Added category fetching for rss2 feeds</message>
  <tree>6fc0e8605784ed51aaa42bc772ec8878296d949e</tree>
  <committer>
    <name>Jonathan Stott</name>
    <email>jonathan.stott@gmail.com</email>
  </committer>
</commit>
