Forum: Ruby on Rails Including iTunes data into ruby output of RSS2.0...?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Dave (Guest)
on 2006-06-08 06:15
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/AllAboutEve... />
<itunes:author>author</itunes:author>

How could I generate this within the Ruby code? My attempts so far have
failed... :-!

Thanks!
unknown (Guest)
on 2006-06-08 15:59
(Received via mailing list)
On Jun 7, 2006, at 9:15 PM, Dave wrote:

>     xml.author 'Everyone'
> 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 (Guest)
on 2006-06-08 19:06
(Received via mailing list)
removed_email_address@domain.invalid wrote:
>>   xml.channel do
>> <itunes:image
> 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
This topic is locked and can not be replied to.