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.
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.
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