# Podcast API?

**URL:** <https://www.ruby-forum.com/t/podcast-api/82572>\
**Category:** Rails\
**Created:** [January 19, 2007, 4:31pm UTC](https://www.ruby-forum.com/t/podcast-api/82572 "2007-01-19T16:31:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![bart](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/f19dbf/32.png) [@bart](https://www.ruby-forum.com/u/bart)\
**Post date:** [January 19, 2007, 4:31pm UTC](https://www.ruby-forum.com/t/podcast-api/82572/1 "2007-01-19T16:31:27Z")

</div>

Hi,  
I’m looking into developing an API for publishing videso/audio/etc to  
iTunes using Rails. Has anyone done anything like this? or can point  
me in the right direction? The web doesn’t seem to have anything on  
it, regarding Rails or other technologies.

Thanks

---

<div class="post-metadata">

**Author:** ![bart](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/f19dbf/32.png) [@bart](https://www.ruby-forum.com/u/bart)\
**Post date:** [September 25, 2007, 10:36pm UTC](https://www.ruby-forum.com/t/podcast-api/82572/2 "2007-09-25T22:36:43Z")

</div>

Thanks Rick!

---

<div class="post-metadata">

**Author:** ![bart](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/f19dbf/32.png) [@bart](https://www.ruby-forum.com/u/bart)\
**Post date:** [September 25, 2007, 10:42pm UTC](https://www.ruby-forum.com/t/podcast-api/82572/3 "2007-09-25T22:42:11Z")

</div>

On 1/14/07, Bart [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hi,  
> I’m looking into developing an API for publishing videso/audio/etc to  
> iTunes using Rails. Has anyone done anything like this? or can point  
> me in the right direction? The web doesn’t seem to have anything on  
> it, regarding Rails or other technologies.
> 
> Thanks

iTunes uses RSS. Just publish RSS with the itunes tags, and anyone  
can add that feed to itunes and subscribe. Yahoo has some media  
extensions to RSS’s enclosure element as well.

[http://www.apple.com/itunes/store/podcaststechspecs.html](http://www.apple.com/itunes/store/podcaststechspecs.html)

> **[Help for your Yahoo Account](https://help.yahoo.com/kb/account)**

–  
Rick O.  
[http://weblog.techno-weenie.net](http://weblog.techno-weenie.net)  
[http://mephistoblog.com](http://mephistoblog.com)

---

<div class="post-metadata">

**Author:** ![bart](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/f19dbf/32.png) [@bart](https://www.ruby-forum.com/u/bart)\
**Post date:** [September 25, 2007, 10:49pm UTC](https://www.ruby-forum.com/t/podcast-api/82572/4 "2007-09-25T22:49:07Z")

</div>

you might also look at OPML parsing since many of the podcatchers use  
it…and if you want people to be able to export their subscriptions  
into  
your app itd be good to have a parser.

here’s one i’ve used in the past (i didn’t write it, but it works)

# 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 =\> [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

require ‘rexml/Document’

opml = REXML::Document.new(File.read(‘ipodder-subscriptions.opml’))  
feeds = parse\_opml(opml.elements[‘opml/body’])

On 1/14/07, Bart [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Thanks Rick!
> 
> >

–  
Ed Hickey  
Developer  
Litmus Media  
816-533-0409  
removed\_email\_address@domain.invalid  
A Member of Think Partnership, Inc  
[www.ThinkPartnership.com](http://www.ThinkPartnership.com)  
Amex ticker symbol: THK
