get the latest podcasts from itunes store with link by RSS, JSON or something
Asked Answered
P

4

4

i'm trying to get the latest podcast informations out of "itunes store" to work with this data in several applications (iphone app and web app).

Is there a way to get this informations? RSS, JSON or something?

i want to work with this informations in objective-c and on a website with php or js.

Is my question clear? :(

//edit: anything unclear? leave a comment, if yes

Prussia answered 12/5, 2010 at 7:52 Comment(8)
Are you trying to get an aggregated feed of generally "the latest podcasts as seen on iTunes", or are you interested in a feed of a specific podcast?Hoagland
yes i want a specific "feed" or something of a specific podcast, so that i can get the latest episodes (name, date, lentgh e.g.)Prussia
What exactly do you want to get out of the store? It just provides a directory to find RSS feeds of podcasts, but the feeds do not go through the store. Are you asking for programmatic access to the directory?Hoagland
yes i do. i want to get all episodes from one specific podcast (the name, the publish date and a link to the store, if its possible)Prussia
I'm still unclear on what you want to do. If you want to get all episodes of one specific podcast, you don't need to go through the store. The podcast has its own feed somewhere independent of the store. For example, the TWiT podcast is at leoville.tv/podcasts/twit.xml.Hoagland
okay fine, that sounds good. any way to get this url for a podcast?Prussia
Sorry, please be clear: Do you want the URL of a podcast? Then I'm not sure where the problem is; just go to the website of your podcast of choice and look for the RSS feed. Or are you looking for URLs of podcasts (plural), i.e. a directory API? These are two very different things and I'm still not sure which one you want.Hoagland
so i want the URL of the RSS feed! isnt there another way then to go to the website of this podcast and search for the feed? some podcasts dont publish their RSS Feed. I'm looking for a way to get the RSS Feed URL of a Podcast out of iTunes.Prussia
S
10

Based on your question, I just tried to find a way to do this.

  1. So you'll need the podcast ID (should be obvious from the URL if you have it; for instance http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewPodcast?id=82884735 has the ID "82884735", and http://itunes.apple.com/us/podcast/this-week-in-tech-mp3-edition/id73329404 has the ID "73329404").

  2. ???

  3. Plug the ID into the URL https://buy.itunes.apple.com/WebObjects/MZFinance.woa/wa/com.apple.jingle.app.finance.DirectAction/subscribePodcast?id={ID}&wasWarnedAboutPodcasts=true and get the data, where {ID} is your podcast ID. It's important here to change your user agent string to iTunes. For this experiment, I used "iTunes/7.4.1". If you don't change it, you'll get something very different.

  4. You'll end up with XML data; an XML plist enclosed in Document and Protocol tags. It will look like

    <Document> <Protocol> <plist version="1.0"> ... </plist> </Protocol> </Document>

You can pull the plist data from this and use a library to manipulate it if your language of choice has one. Essentially there'll be a "root" dictionary and a dictionary inside it called "subscribe-podcast". This "subscribe-podcast" dictionary will have a key called "feedURL" – nab the value, and you'll have your RSS feed. I'd recommend trying these steps and following along.

An easier to follow representation of the plist is the NeXTSTEP format, which actually looks a bit like JSON. An excerpt of a dummy podcast plist transformed into this format is as follows (remember that you'll really be getting back an XML-like file):

{
    "subscribe-podcast" = {
        …
        feedURL = "http://feeds.feedburner.com/yaddayaddayadda"; 
        …
        podcastName = "Lorem Ipsum"; 
        …
    }; 
}

Now you'll notice in the steps I described that step 2 is missing. This is because I looked at the data that Apple was giving me back manually to get to the URL in step 3. Chances are that you'll want to parse the data yourself in case Apple decides to change the URL, but maybe it's probable for the intermediate HTML to change and break your program anyway. I might go back and look at documenting the steps that should be taken to get at our magic URL in step 3.

I tried out this strategy with a few podcasts, and it seems to work well in giving me the RSS feed. Since I don't know any of the languages that you asked for, I can't make any recommendations code-wise. Hope it can get you on your way, though.

Seftton answered 22/5, 2010 at 4:59 Comment(0)
S
7
  1. Extract id from iTunes-url https://itunes.apple.com/de/podcast/ard-radio-tatort/id310864997?mt=2&uo=2 (in this example "310864997")
  2. You can extract the id, by using the following regex: /id(\d+)/
  3. Enter id into the following url, to get the feed information via Apple's api https://itunes.apple.com/lookup?id={FEED_ID}&entity=podcast
  4. The lookup service will return a JSON file. You will find the rss url at the 'feedUrl'-field inside the JSON.

There are two adavantages over Volt's solution.

  1. You don't have to fake the browser agent.
  2. You get clean and simple JSON as response.

If you want to see an live example, have a look at xTunes-Podcatcher, where I implemented the above described technique/steps myself. Just enter your iTunes podcast url and get the RSS url out of it.

Sacrilegious answered 11/7, 2015 at 9:52 Comment(6)
@DragonLord Edited my answer... Is it better, now?Sacrilegious
That's better; please be sure to disclose your affiliation in the future and don't make too many promotional posts of this sort.Surmullet
@DragonLord - if you check my Stackoverflow profile, you'll see that I barely never promote my own stuff.Sacrilegious
You still need to disclose your affiliation in your answer.Planchet
@MartijnPieters "... where I implemented the above described technique/steps." - Isn't that a disclosure?Sacrilegious
Ah, I missed that part. It's not that obvious though.Planchet
A
-1

If there is an RSS feed for the data you're looking for, you can use this RSS/Atom Parser for iPhone I've just released.

Hope it can be of some use!

Alviani answered 16/5, 2010 at 14:34 Comment(1)
so my problem is to GET the feed, not to handle it.Prussia
K
-2

I got the required podcast rss from feedburner.com indirectly. i couldnt find it from the site. but i searched google for the required 'podcast name' along with feedburner in the keyword. The search result had the podcast rss page corresponding to the name from feedburner.

Klump answered 7/8, 2011 at 17:3 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.