Browse files

Parse categories (tags).

  • Loading branch information...
1 parent ff334ea commit 1d5d571b40161438f5700322d74961ca878e76bf @djanowski djanowski committed Nov 13, 2009
View
1 lib/birdfeed/format/atom10.rb
@@ -26,6 +26,7 @@ def parse(content)
item.link = item_node.css('link').attr('href').to_s
item.id = item_node.css('id').text
item.author = item_node.css('author > name').text
+ item.categories = item_node.css("category").map { |el| el.attributes["term"].to_s }
end
end
end
View
1 lib/birdfeed/format/rss20.rb
@@ -26,6 +26,7 @@ def parse(content)
item.link = item_node.css('link').text
item.id = item_node.css('guid').text
item.author = item_node.css('author').text if item_node.css('author')
+ item.categories = item_node.css("category").map { |el| el.text }
end
end
end
View
2 lib/birdfeed/item.rb
@@ -1,6 +1,6 @@
module BirdFeed
class Item
- attr_accessor :node, :xml, :title, :link, :description, :published_at, :id, :author
+ attr_accessor :node, :xml, :title, :link, :description, :published_at, :id, :author, :categories
def initialize(&block)
yield self if block_given?
View
558 spec/fixtures/bbc.rss
@@ -0,0 +1,558 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<?xml-stylesheet title="XSL_formatting" type="text/xsl" href="/shared/bsp/xsl/rss/nolsol.xsl"?>
+<rss version="2.0" xmlns:media="http://search.yahoo.com/mrss">
+ <channel>
+ <title>BBC News | News Front Page | World Edition</title>
+a <link>http://news.bbc.co.uk/go/rss/-/2/hi/default.stm</link>
+ <description>Get the latest BBC World news: international news,
+ features and analysis from Africa, Americas, South Asia,
+ Asia-Pacific, Europe and the Middle East.</description>
+ <language>en-gb</language>
+ <lastBuildDate>Fri, 13 Nov 2009 17:44:18 GMT</lastBuildDate>
+ <copyright>Copyright: (C) British Broadcasting Corporation, see
+ http://news.bbc.co.uk/2/hi/help/rss/4498287.stm for terms and
+ conditions of reuse</copyright>
+ <docs>http://www.bbc.co.uk/syndication/</docs>
+ <ttl>15</ttl>
+ <image>
+ <title>BBC News</title>
+ <url>
+ http://news.bbc.co.uk/nol/shared/img/bbc_news_120x60.gif</url>
+ <link>http://news.bbc.co.uk/go/rss/-/2/hi/default.stm</link>
+ </image>
+ <item>
+ <title>9/11 suspects face New York trial</title>
+ <description>Prosecutors will seek the death penalty in a New
+ York trial of the alleged 9/11 mastermind and four other
+ suspects, the US confirms.</description>
+ <link>
+ http://news.bbc.co.uk/go/rss/-/2/hi/americas/8359623.stm</link>
+ <guid isPermaLink="false">
+ http://news.bbc.co.uk/2/hi/americas/8359623.stm</guid>
+ <pubDate>Fri, 13 Nov 2009 17:28:53 GMT</pubDate>
+ <category>Americas</category>
+ <media:thumbnail width="66" height="49"
+ url="http://newsimg.bbc.co.uk/media/images/46354000/jpg/_46354724_007919127-1.jpg" />
+ </item>
+ <item>
+ <title>Major fire at Russia arms depot</title>
+ <description>At least one person is said to have died and 35
+ are missing after explosions at an arms depot in central
+ Russia.</description>
+ <link>
+ http://news.bbc.co.uk/go/rss/-/2/hi/europe/8359359.stm</link>
+ <guid isPermaLink="false">
+ http://news.bbc.co.uk/2/hi/europe/8359359.stm</guid>
+ <pubDate>Fri, 13 Nov 2009 17:05:54 GMT</pubDate>
+ <category>Europe</category>
+ <media:thumbnail width="66" height="49"
+ url="http://newsimg.bbc.co.uk/media/images/46728000/jpg/_46728739_blast.jpg" />
+ </item>
+ <item>
+ <title>'Large amounts' of water on Moon</title>
+ <description>Nasa's experiment last month to find water on
+ the Moon was a major success, agency scientists have
+ announced.</description>
+ <link>
+ http://news.bbc.co.uk/go/rss/-/2/hi/science/nature/8359744.stm</link>
+ <guid isPermaLink="false">
+ http://news.bbc.co.uk/2/hi/science/nature/8359744.stm</guid>
+ <pubDate>Fri, 13 Nov 2009 17:30:39 GMT</pubDate>
+ <category>Science &amp; Environment</category>
+ <media:thumbnail width="66" height="49"
+ url="http://newsimg.bbc.co.uk/media/images/45343000/gif/_45343197_breaking_66x49_2.gif" />
+ </item>
+ <item>
+ <title>Chinese schools collapse in snow</title>
+ <description>Heavy snowfall in China causes 38 deaths in road
+ accidents and collapsed buildings, state news media
+ report.</description>
+ <link>
+ http://news.bbc.co.uk/go/rss/-/2/hi/asia-pacific/8358162.stm</link>
+ <guid isPermaLink="false">
+ http://news.bbc.co.uk/2/hi/asia-pacific/8358162.stm</guid>
+ <pubDate>Fri, 13 Nov 2009 07:29:21 GMT</pubDate>
+ <category>Asia-Pacific</category>
+ <media:thumbnail width="66" height="49"
+ url="http://newsimg.bbc.co.uk/media/images/46721000/jpg/_46721596_beijing_afp.jpg" />
+ </item>
+ <item>
+ <title>Navy crew 'watched' pirate kidnap</title>
+ <description>The crew of a Royal Navy vessel watched as a
+ British couple were taken hostage by Somali pirates,
+ Whitehall officials have confirmed.</description>
+ <link>
+ http://news.bbc.co.uk/go/rss/-/2/hi/uk_news/8359575.stm</link>
+ <guid isPermaLink="false">
+ http://news.bbc.co.uk/2/hi/uk_news/8359575.stm</guid>
+ <pubDate>Fri, 13 Nov 2009 17:20:47 GMT</pubDate>
+ <category>UK</category>
+ <media:thumbnail width="66" height="49"
+ url="http://newsimg.bbc.co.uk/media/images/46728000/jpg/_46728503_boat_226.jpg" />
+ </item>
+ <item>
+ <title>Eurozone emerges from recession</title>
+ <description>The eurozone economy has emerged from recession
+ after growing between July and September, figures
+ show.</description>
+ <link>
+ http://news.bbc.co.uk/go/rss/-/2/hi/business/8358227.stm</link>
+ <guid isPermaLink="false">
+ http://news.bbc.co.uk/2/hi/business/8358227.stm</guid>
+ <pubDate>Fri, 13 Nov 2009 10:39:39 GMT</pubDate>
+ <category>Business</category>
+ <media:thumbnail width="66" height="49"
+ url="http://newsimg.bbc.co.uk/media/images/46198000/jpg/_46198627_frenchshoopers2_226_afp.jpg" />
+ </item>
+ <item>
+ <title>Fort Hood suspect 'is paralysed'</title>
+ <description>The army psychiatrist suspected of shooting dead
+ 13 people at a crowded military base is paralysed, his lawyer
+ says.</description>
+ <link>
+ http://news.bbc.co.uk/go/rss/-/2/hi/americas/8359316.stm</link>
+ <guid isPermaLink="false">
+ http://news.bbc.co.uk/2/hi/americas/8359316.stm</guid>
+ <pubDate>Fri, 13 Nov 2009 17:03:26 GMT</pubDate>
+ <category>Americas</category>
+ <media:thumbnail width="66" height="49"
+ url="http://newsimg.bbc.co.uk/media/images/46697000/jpg/_46697796_008239233-1.jpg" />
+ </item>
+ <item>
+ <title>US and Japan to renew alliance</title>
+ <description>US President Barack Obama and Japanese PM Yukio
+ Hatoyama agree in Tokyo on the need to renew their
+ alliance.</description>
+ <link>
+ http://news.bbc.co.uk/go/rss/-/2/hi/asia-pacific/8357561.stm</link>
+ <guid isPermaLink="false">
+ http://news.bbc.co.uk/2/hi/asia-pacific/8357561.stm</guid>
+ <pubDate>Fri, 13 Nov 2009 13:08:06 GMT</pubDate>
+ <category>Asia-Pacific</category>
+ <media:thumbnail width="66" height="49"
+ url="http://newsimg.bbc.co.uk/media/images/46723000/jpg/_46723306_008270835-1.jpg" />
+ </item>
+ <item>
+ <title>Windows 7 graphics 'inspired by Mac'</title>
+ <description>A Microsoft executive was quoted as saying that
+ Windows 7's graphical changes were inspired by Apple's Mac
+ OS.</description>
+ <link>
+ http://news.bbc.co.uk/go/rss/-/2/hi/technology/8358712.stm</link>
+ <guid isPermaLink="false">
+ http://news.bbc.co.uk/2/hi/technology/8358712.stm</guid>
+ <pubDate>Fri, 13 Nov 2009 11:43:18 GMT</pubDate>
+ <category>Technology</category>
+ <media:thumbnail width="66" height="49"
+ url="http://newsimg.bbc.co.uk/media/images/46723000/jpg/_46723888_-6.jpg" />
+ </item>
+ <item>
+ <title>How Canadian cat sparked rumours of Lady Thatcher's
+ death</title>
+ <description>A text message announcing the death of a
+ minister's cat, named Thatcher after his political heroine,
+ sparks an embarrassing diplomatic incident in
+ Canada.</description>
+ <link>
+ http://news.bbc.co.uk/go/rss/-/2/hi/americas/8358544.stm</link>
+ <guid isPermaLink="false">
+ http://news.bbc.co.uk/2/hi/americas/8358544.stm</guid>
+ <pubDate>Fri, 13 Nov 2009 10:59:53 GMT</pubDate>
+ <category>Americas</category>
+ <media:thumbnail width="66" height="49"
+ url="http://newsimg.bbc.co.uk/media/images/46723000/jpg/_46723020_008262145-1.jpg" />
+ </item>
+ <item>
+ <title>Row as Spanish teenagers get lessons in
+ 'self-love'</title>
+ <description>A campaign in the Spanish region of Extremadura
+ to give teenagers advice on how to masturbate sparks
+ anger.</description>
+ <link>
+ http://news.bbc.co.uk/go/rss/-/2/hi/europe/8358629.stm</link>
+ <guid isPermaLink="false">
+ http://news.bbc.co.uk/2/hi/europe/8358629.stm</guid>
+ <pubDate>Fri, 13 Nov 2009 11:44:38 GMT</pubDate>
+ <category>Europe</category>
+ <media:thumbnail width="66" height="49"
+ url="http://newsimg.bbc.co.uk/media/images/46723000/jpg/_46723932_classroom_66_afp.jpg" />
+ </item>
+ <item>
+ <title>Algeria footballers hurt in Cairo</title>
+ <description>Four Algerian footballers are injured when their
+ team bus comes under attack from stone throwers as it arrives
+ in Cairo.</description>
+ <link>
+ http://news.bbc.co.uk/go/rss/-/2/hi/middle_east/8358365.stm</link>
+ <guid isPermaLink="false">
+ http://news.bbc.co.uk/2/hi/middle_east/8358365.stm</guid>
+ <pubDate>Fri, 13 Nov 2009 15:02:53 GMT</pubDate>
+ <category>Middle East</category>
+ <media:thumbnail width="66" height="49"
+ url="http://newsimg.bbc.co.uk/media/images/46722000/jpg/_46722451_algeriaarrival6649afp.jpg" />
+ </item>
+ <item>
+ <title>Live - South Africa v England</title>
+ <description>Eoin Morgan hits an unbeaten 85 as England post
+ a national record of 202-6 in the first Twenty20
+ international against South Africa.</description>
+ <link>
+ http://news.bbc.co.uk/go/rss/-/sport2/hi/cricket/england/8351189.stm</link>
+ <guid isPermaLink="false">
+ http://news.bbc.co.uk/sport2/hi/cricket/england/8351189.stm</guid>
+ <pubDate>Fri, 13 Nov 2009 15:15:38 GMT</pubDate>
+ <category>England</category>
+ <media:thumbnail width="66" height="49"
+ url="http://newsimg.bbc.co.uk/media/images/46728000/jpg/_46728834_colly66.jpg" />
+ </item>
+ <item>
+ <title>Nadal ends Tsonga's London hopes</title>
+ <description>Rafael Nadal beats Jo-Wilfried Tsonga at the
+ Paris Masters, meaning Fernando Verdasco claims the last
+ place at the World Tour Finals in London.</description>
+ <link>
+ http://news.bbc.co.uk/go/rss/-/sport2/hi/tennis/8359416.stm</link>
+ <guid isPermaLink="false">
+ http://news.bbc.co.uk/sport2/hi/tennis/8359416.stm</guid>
+ <pubDate>Fri, 13 Nov 2009 17:42:44 GMT</pubDate>
+ <category>Tennis</category>
+ <media:thumbnail width="66" height="49"
+ url="http://newsimg.bbc.co.uk/media/images/46729000/jpg/_46729069_nadalap226.jpg" />
+ </item>
+ <item>
+ <title>What are your superstitions?</title>
+ <description>Friday the 13th is traditionally seen by many
+ people as an unlucky date. Are you
+ superstitious?</description>
+ <link>
+ http://newsforums.bbc.co.uk/nol/thread.jspa?forumID=7232&amp;edition=2</link>
+ <guid isPermaLink="false">
+ http://newsforums.bbc.co.uk/nol/thread.jspa?forumID=7232&amp;edition=2</guid>
+ <pubDate>Fri, 13 Nov 2009 12:07:34 GMT</pubDate>
+ <category>Have Your Say</category>
+ <media:thumbnail width="66" height="49"
+ url="http://newsimg.bbc.co.uk/media/images/46724000/jpg/_46724320_-1.jpg" />
+ </item>
+ <item>
+ <title>BBC World News</title>
+ <description></description>
+ <link>http://www.bbcworldnews.com/Pages/default.aspx</link>
+ <guid isPermaLink="false">
+ http://www.bbcworldnews.com/Pages/default.aspx</guid>
+ <pubDate>Tue, 29 Sep 2009 11:16:12 GMT</pubDate>
+ <category>Programmes</category>
+ </item>
+ <item>
+ <title>Rain and winds begin hitting UK</title>
+ <description>Heavy rain and high winds cause flooding in some
+ parts of southern England, as a weekend of UK storms is
+ forecast.</description>
+ <link>
+ http://news.bbc.co.uk/go/rss/-/2/hi/uk_news/8358530.stm</link>
+ <guid isPermaLink="false">
+ http://news.bbc.co.uk/2/hi/uk_news/8358530.stm</guid>
+ <pubDate>Fri, 13 Nov 2009 17:14:50 GMT</pubDate>
+ <category>UK</category>
+ <media:thumbnail width="66" height="49"
+ url="http://newsimg.bbc.co.uk/media/images/46723000/jpg/_46723336_004374851-1.jpg" />
+ </item>
+ <item>
+ <title>Stalker in bolt gun murder jailed</title>
+ <description>A "delusional" stalker who murdered a mother
+ with a bolt gun, hours after she had warned police about him,
+ is jailed for life.</description>
+ <link>
+ http://news.bbc.co.uk/go/rss/-/2/hi/uk_news/england/suffolk/8357977.stm</link>
+ <guid isPermaLink="false">
+ http://news.bbc.co.uk/2/hi/uk_news/england/suffolk/8357977.stm</guid>
+ <pubDate>Fri, 13 Nov 2009 17:04:44 GMT</pubDate>
+ <category>Suffolk</category>
+ <media:thumbnail width="66" height="49"
+ url="http://newsimg.bbc.co.uk/media/images/46726000/jpg/_46726451_mcfarlanejohn.jpg" />
+ </item>
+ <item>
+ <title>Radcliffe denies drug allegations</title>
+ <description>Harry Potter actor Daniel Radcliffe
+ "categorically" denies newspaper allegations he was
+ photographed smoking cannabis.</description>
+ <link>
+ http://news.bbc.co.uk/go/rss/-/2/hi/entertainment/8358998.stm</link>
+ <guid isPermaLink="false">
+ http://news.bbc.co.uk/2/hi/entertainment/8358998.stm</guid>
+ <pubDate>Fri, 13 Nov 2009 13:18:05 GMT</pubDate>
+ <category>Entertainment</category>
+ <media:thumbnail width="66" height="49"
+ url="http://newsimg.bbc.co.uk/media/images/46725000/jpg/_46725083_radcliffe_226getty.jpg" />
+ </item>
+ <item>
+ <title>Brown hopeful over Afghan boost</title>
+ <description>Gordon Brown says he is hopeful he will be able
+ to persuade allies to send more military personnel to
+ Afghanistan.</description>
+ <link>
+ http://news.bbc.co.uk/go/rss/-/2/hi/uk_news/politics/8358134.stm</link>
+ <guid isPermaLink="false">
+ http://news.bbc.co.uk/2/hi/uk_news/politics/8358134.stm</guid>
+ <pubDate>Fri, 13 Nov 2009 14:47:47 GMT</pubDate>
+ <category>UK Politics</category>
+ <media:thumbnail width="66" height="49"
+ url="http://newsimg.bbc.co.uk/media/images/46721000/jpg/_46721488_006767745-1.jpg" />
+ </item>
+ <item>
+ <title>Inmate-sex prison officer jailed</title>
+ <description>A former prison officer who had a baby with an
+ inmate is jailed for 30 months for misconduct in a public
+ office.</description>
+ <link>
+ http://news.bbc.co.uk/go/rss/-/2/hi/uk_news/england/beds/bucks/herts/8358597.stm</link>
+ <guid isPermaLink="false">
+ http://news.bbc.co.uk/2/hi/uk_news/england/beds/bucks/herts/8358597.stm</guid>
+ <pubDate>Fri, 13 Nov 2009 12:15:45 GMT</pubDate>
+ <category>Beds/Bucks/Herts</category>
+ <media:thumbnail width="66" height="49"
+ url="http://newsimg.bbc.co.uk/media/images/46728000/jpg/_46728353_kelly-anne_mcdadejpgweb.jpg" />
+ </item>
+ <item>
+ <title>Rape re-enactment killer guilty</title>
+ <description>A convicted murderer released only to re-enact
+ elements of his crime is found guilty of raping a woman at
+ knifepoint in her home.</description>
+ <link>
+ http://news.bbc.co.uk/go/rss/-/2/hi/uk_news/england/bristol/somerset/8359419.stm</link>
+ <guid isPermaLink="false">
+ http://news.bbc.co.uk/2/hi/uk_news/england/bristol/somerset/8359419.stm</guid>
+ <pubDate>Fri, 13 Nov 2009 16:37:15 GMT</pubDate>
+ <category>Bristol</category>
+ <media:thumbnail width="66" height="49"
+ url="http://newsimg.bbc.co.uk/media/images/46727000/jpg/_46727828_kenneth-shirley226.jpg" />
+ </item>
+ <item>
+ <title>Changing times</title>
+ <description>Is the end in sight for Russia's 11 time
+ zones?</description>
+ <link>
+ http://news.bbc.co.uk/go/rss/-/2/hi/europe/8357630.stm</link>
+ <guid isPermaLink="false">
+ http://news.bbc.co.uk/2/hi/europe/8357630.stm</guid>
+ <pubDate>Fri, 13 Nov 2009 06:11:55 GMT</pubDate>
+ <category>Europe</category>
+ <media:thumbnail width="66" height="49"
+ url="http://newsimg.bbc.co.uk/media/images/46716000/jpg/_46716059_008266692-1.jpg" />
+ </item>
+ <item>
+ <title>Suicide mission</title>
+ <description>The boy groomed by the Taliban to become a
+ bomber</description>
+ <link>
+ http://news.bbc.co.uk/go/rss/-/2/hi/south_asia/8357011.stm</link>
+ <guid isPermaLink="false">
+ http://news.bbc.co.uk/2/hi/south_asia/8357011.stm</guid>
+ <pubDate>Thu, 12 Nov 2009 19:00:05 GMT</pubDate>
+ <category>South Asia</category>
+ </item>
+ <item>
+ <title>It's quiz time!</title>
+ <description>Why did a mini dress cause a mighty
+ row?</description>
+ <link>
+ http://news.bbc.co.uk/go/rss/-/2/hi/in_depth/8357729.stm</link>
+ <guid isPermaLink="false">
+ http://news.bbc.co.uk/2/hi/in_depth/8357729.stm</guid>
+ <pubDate>Fri, 13 Nov 2009 00:16:15 GMT</pubDate>
+ <category>Special Reports</category>
+ </item>
+ <item>
+ <title>Eurostar is 15</title>
+ <description>Will rival operators cut short birthday
+ celebrations?</description>
+ <link>
+ http://news.bbc.co.uk/go/rss/-/2/hi/business/8353277.stm</link>
+ <guid isPermaLink="false">
+ http://news.bbc.co.uk/2/hi/business/8353277.stm</guid>
+ <pubDate>Fri, 13 Nov 2009 00:02:19 GMT</pubDate>
+ <category>Business</category>
+ <media:thumbnail width="66" height="49"
+ url="http://newsimg.bbc.co.uk/media/images/46715000/jpg/_46715803_eurostar1.jpg" />
+ </item>
+ <item>
+ <title>Furry fixation</title>
+ <description>Why do some folk don animal suits and go
+ grooming?</description>
+ <link>
+ http://news.bbc.co.uk/go/rss/-/2/hi/uk_news/magazine/8355287.stm</link>
+ <guid isPermaLink="false">
+ http://news.bbc.co.uk/2/hi/uk_news/magazine/8355287.stm</guid>
+ <pubDate>Fri, 13 Nov 2009 12:37:34 GMT</pubDate>
+ <category>Magazine</category>
+ <media:thumbnail width="66" height="49"
+ url="http://newsimg.bbc.co.uk/media/images/46724000/jpg/_46724080_da.6649.jpg" />
+ </item>
+ <item>
+ <title>Day in pictures</title>
+ <description>Eye-catching images from around the
+ world</description>
+ <link>
+ http://news.bbc.co.uk/go/rss/-/2/hi/in_pictures/8358985.stm</link>
+ <guid isPermaLink="false">
+ http://news.bbc.co.uk/2/hi/in_pictures/8358985.stm</guid>
+ <pubDate>Fri, 13 Nov 2009 17:40:19 GMT</pubDate>
+ <category>In Pictures</category>
+ <media:thumbnail width="66" height="49"
+ url="http://newsimg.bbc.co.uk/media/images/46725000/jpg/_46725091_india_afp66i.jpg" />
+ </item>
+ <item>
+ <title>No licence to kill for SA police</title>
+ <description>South Africa's president says the police do not
+ have a licence to kill, after a minister said they should
+ shoot criminals.</description>
+ <link>
+ http://news.bbc.co.uk/go/rss/-/2/hi/africa/8359516.stm</link>
+ <guid isPermaLink="false">
+ http://news.bbc.co.uk/2/hi/africa/8359516.stm</guid>
+ <pubDate>Fri, 13 Nov 2009 16:50:57 GMT</pubDate>
+ <category>Africa</category>
+ <media:thumbnail width="66" height="49"
+ url="http://newsimg.bbc.co.uk/media/images/46728000/jpg/_46728683_sapolicegunap.jpg" />
+ </item>
+ <item>
+ <title>US pursues 'Iran-linked' charity</title>
+ <description>US prosecutors begin legal action to seize
+ property owned by a Muslim charity suspected to have links
+ with Iran.</description>
+ <link>
+ http://news.bbc.co.uk/go/rss/-/2/hi/middle_east/8358065.stm</link>
+ <guid isPermaLink="false">
+ http://news.bbc.co.uk/2/hi/middle_east/8358065.stm</guid>
+ <pubDate>Fri, 13 Nov 2009 00:56:17 GMT</pubDate>
+ <category>Middle East</category>
+ <media:thumbnail width="66" height="49"
+ url="http://newsimg.bbc.co.uk/media/images/46721000/jpg/_46721345_008269292-2.jpg" />
+ </item>
+ <item>
+ <title>Tamil asylum seekers leave ship</title>
+ <description>A group of 22 Sri Lankan asylum seekers comes
+ ashore after a month on an Australian ship off Indonesia,
+ officials say.</description>
+ <link>
+ http://news.bbc.co.uk/go/rss/-/2/hi/asia-pacific/8358892.stm</link>
+ <guid isPermaLink="false">
+ http://news.bbc.co.uk/2/hi/asia-pacific/8358892.stm</guid>
+ <pubDate>Fri, 13 Nov 2009 13:01:06 GMT</pubDate>
+ <category>Asia-Pacific</category>
+ <media:thumbnail width="66" height="49"
+ url="http://newsimg.bbc.co.uk/media/images/46724000/jpg/_46724496_oceanicviking_ap.jpg" />
+ </item>
+ <item>
+ <title>Turkey unveils reforms for Kurds</title>
+ <description>The Turkish government announces plans to expand
+ the rights of Kurds, who for years have alleged
+ discrimination.</description>
+ <link>
+ http://news.bbc.co.uk/go/rss/-/2/hi/europe/8359582.stm</link>
+ <guid isPermaLink="false">
+ http://news.bbc.co.uk/2/hi/europe/8359582.stm</guid>
+ <pubDate>Fri, 13 Nov 2009 17:01:54 GMT</pubDate>
+ <category>Europe</category>
+ <media:thumbnail width="66" height="49"
+ url="http://newsimg.bbc.co.uk/media/images/46728000/jpg/_46728463_turkcommandoafp66i.jpg" />
+ </item>
+ <item>
+ <title>Syria urges French Mid-East role</title>
+ <description>Syrian President Bashar al-Assad calls for
+ France to play a bigger role in Middle East peace efforts
+ during a visit to Paris.</description>
+ <link>
+ http://news.bbc.co.uk/go/rss/-/2/hi/europe/8358689.stm</link>
+ <guid isPermaLink="false">
+ http://news.bbc.co.uk/2/hi/europe/8358689.stm</guid>
+ <pubDate>Fri, 13 Nov 2009 11:37:51 GMT</pubDate>
+ <category>Europe</category>
+ <media:thumbnail width="66" height="49"
+ url="http://newsimg.bbc.co.uk/media/images/46723000/jpg/_46723546_008267097-1.jpg" />
+ </item>
+ <item>
+ <title>Bombers hit Pakistan spy agency</title>
+ <description>A bomb hits Pakistan's intelligence agency in
+ the north-western city of Peshawar, killing at least 12,
+ officials say.</description>
+ <link>
+ http://news.bbc.co.uk/go/rss/-/2/hi/south_asia/8358109.stm</link>
+ <guid isPermaLink="false">
+ http://news.bbc.co.uk/2/hi/south_asia/8358109.stm</guid>
+ <pubDate>Fri, 13 Nov 2009 11:22:26 GMT</pubDate>
+ <category>South Asia</category>
+ <media:thumbnail width="66" height="49"
+ url="http://newsimg.bbc.co.uk/media/images/46721000/jpg/_46721469_008269914-1.jpg" />
+ </item>
+ <item>
+ <title>US trade gap widens unexpectedly</title>
+ <description>The US trade deficit widened unexpectedly in
+ September by the largest amount in 10 years to $36.5bn,
+ figures show.</description>
+ <link>
+ http://news.bbc.co.uk/go/rss/-/2/hi/business/8359198.stm</link>
+ <guid isPermaLink="false">
+ http://news.bbc.co.uk/2/hi/business/8359198.stm</guid>
+ <pubDate>Fri, 13 Nov 2009 15:48:40 GMT</pubDate>
+ <category>Business</category>
+ <media:thumbnail width="66" height="49"
+ url="http://newsimg.bbc.co.uk/media/images/45212000/jpg/_45212796_dollars66.jpg" />
+ </item>
+ <item>
+ <title>Breast 'regrowth' trial planned</title>
+ <description>A surgical method to regrow breasts after
+ surgery has proven successful in tests on pigs, say
+ researchers.</description>
+ <link>
+ http://news.bbc.co.uk/go/rss/-/2/hi/health/8357195.stm</link>
+ <guid isPermaLink="false">
+ http://news.bbc.co.uk/2/hi/health/8357195.stm</guid>
+ <pubDate>Thu, 12 Nov 2009 18:33:01 GMT</pubDate>
+ <category>Health</category>
+ <media:thumbnail width="66" height="49"
+ url="http://newsimg.bbc.co.uk/media/images/46720000/jpg/_46720773_m122149-coloured_mammogram_of_a_normal_breast.-spl.jpg" />
+ </item>
+ <item>
+ <title>Lifetime Globe prize for Scorsese</title>
+ <description>Veteran director Martin Scorsese is to receive
+ the Cecil B DeMille Award for lifetime achievement at the
+ Golden Globes.</description>
+ <link>
+ http://news.bbc.co.uk/go/rss/-/2/hi/entertainment/8358218.stm</link>
+ <guid isPermaLink="false">
+ http://news.bbc.co.uk/2/hi/entertainment/8358218.stm</guid>
+ <pubDate>Fri, 13 Nov 2009 09:38:25 GMT</pubDate>
+ <category>Entertainment</category>
+ <media:thumbnail width="66" height="49"
+ url="http://newsimg.bbc.co.uk/media/images/46722000/jpg/_46722158_martin_ap66i.jpg" />
+ </item>
+ <item>
+ <title>Big profit from nature protection</title>
+ <description>Money invested in protecting nature can bring
+ huge financial returns, according to a study backed by the
+ UK.</description>
+ <link>
+ http://news.bbc.co.uk/go/rss/-/2/hi/science/nature/8357723.stm</link>
+ <guid isPermaLink="false">
+ http://news.bbc.co.uk/2/hi/science/nature/8357723.stm</guid>
+ <pubDate>Fri, 13 Nov 2009 11:12:38 GMT</pubDate>
+ <category>Science &amp; Environment</category>
+ <media:thumbnail width="66" height="49"
+ url="http://newsimg.bbc.co.uk/media/images/46720000/jpg/_46720267_coralfish226i.jpg" />
+ </item>
+ <item>
+ <title>BBC iPlayer launches Wii channel</title>
+ <description>The BBC iPlayer will be available on the
+ Nintendo Wii as a dedicated channel from 18
+ November.</description>
+ <link>
+ http://news.bbc.co.uk/go/rss/-/2/hi/technology/8357777.stm</link>
+ <guid isPermaLink="false">
+ http://news.bbc.co.uk/2/hi/technology/8357777.stm</guid>
+ <pubDate>Fri, 13 Nov 2009 10:36:28 GMT</pubDate>
+ <category>Technology</category>
+ <media:thumbnail width="66" height="49"
+ url="http://newsimg.bbc.co.uk/media/images/44611000/jpg/_44611952_iplayer1_66.jpg" />
+ </item>
+ </channel>
+</rss>
View
6 spec/specs/format/atom_10_spec.rb
@@ -97,6 +97,12 @@
it "should parse id" do
@item.id.should eql('tag:twitter.com,2007:http://twitter.com/bradgessler/statuses/1159405159')
end
+
+ it "should have categories" do
+ item = Atom10.parse(feed(:flickr, :atom)).items[3]
+
+ item.categories.sort.should eql(["2008", "summer", "ycombinator"])
+ end
it "should have xml" do
@item.xml.should_not be_nil
View
6 spec/specs/format/rss_20_spec.rb
@@ -96,6 +96,12 @@
it "should parse id" do
@item.id.should eql('http://www.cnn.com/2009/US/01/29/porch.cave/index.html?eref=rss_topstories')
end
+
+ it "should have categories" do
+ item = Rss20.parse(feed(:bbc, :rss)).items[0]
+
+ item.categories.sort.should eql(["Americas"])
+ end
it "should have xml" do
@item.xml.should_not be_nil

0 comments on commit 1d5d571

Please sign in to comment.