Hey all, I''d like to include the iTunes XML data into my RSS feed, generated with the code below: xml.rss ''version'' => ''2.0'', ''xmlns:itunes'' => ''http://www.itunes.com/dtds/podcast-1.0.dtd'' do xml.channel do xml.title ''Title here'' xml.author ''Everyone'' xml.description ''Description here'' xml.link(@base_url + url_for(:controller => ''/programs'')) xml.language ''en-us'' ... However, the iTunes XML tags aren''t a single word (e.g., "description"). Instead, they''re tags with subtags, like the output here: <itunes:image href="http://example.com/podcasts/everything/AllAboutEverything.jpg" /> <itunes:author>author</itunes:author> How could I generate this within the Ruby code? My attempts so far have failed... :-! Thanks! -- Posted via http://www.ruby-forum.com/.
cremes.devlist@mac.com
2006-Jun-08 11:55 UTC
[Rails] Including iTunes data into ruby output of RSS2.0...?
On Jun 7, 2006, at 9:15 PM, Dave wrote:> Hey all, > > I''d like to include the iTunes XML data into my RSS feed, generated > with > the code below: > > xml.rss ''version'' => ''2.0'', ''xmlns:itunes'' => > ''http://www.itunes.com/dtds/podcast-1.0.dtd'' do > xml.channel do > xml.title ''Title here'' > xml.author ''Everyone'' > xml.description ''Description here'' > xml.link(@base_url + url_for(:controller => ''/programs'')) > xml.language ''en-us'' > > ... However, the iTunes XML tags aren''t a single word (e.g., > "description"). Instead, they''re tags with subtags, like the output > here: > > <itunes:image > href="http://example.com/podcasts/everything/ > AllAboutEverything.jpg" /> > <itunes:author>author</itunes:author> > > How could I generate this within the Ruby code? My attempts so far > have > failed... :-!Try taking a look at the ''plist'' gem [1]. The Apple xml format is a bit different and needs to be handled as a special case. cr [1] http://raa.ruby-lang.org/project/plist/ (or do "gem install plist" if you have rubygems installed)
Ross
2006-Jun-08 15:05 UTC
[Rails] Re: Including iTunes data into ruby output of RSS2.0...?
cremes.devlist@mac.com wrote:> > On Jun 7, 2006, at 9:15 PM, Dave wrote: > >> Hey all, >> >> I''d like to include the iTunes XML data into my RSS feed, generated with >> the code below: >> >> xml.rss ''version'' => ''2.0'', ''xmlns:itunes'' => >> ''http://www.itunes.com/dtds/podcast-1.0.dtd'' do >> xml.channel do >> xml.title ''Title here'' >> xml.author ''Everyone'' >> xml.description ''Description here'' >> xml.link(@base_url + url_for(:controller => ''/programs'')) >> xml.language ''en-us'' >> >> ... However, the iTunes XML tags aren''t a single word (e.g., >> "description"). Instead, they''re tags with subtags, like the output >> here: >> >> <itunes:image >> href="http://example.com/podcasts/everything/ AllAboutEverything.jpg" /> >> <itunes:author>author</itunes:author> >> >> How could I generate this within the Ruby code? My attempts so far have >> failed... :-! > > > Try taking a look at the ''plist'' gem [1]. The Apple xml format is a bit > different and needs to be handled as a special case. > > cr > > [1] http://raa.ruby-lang.org/project/plist/ (or do "gem install plist" > if you have rubygems installed)I think he means iTunes podcasting: http://www.apple.com/itunes/podcasts/techspecs.html Search this page for ''namespace'': http://api.rubyonrails.org/classes/Builder/XmlMarkup.html I think the syntax in this case would be: xml.itunes(:description, ''Description here'') -Ross