I am trying to display a list of podcast channels by a particular author. When a podcast is selected, display the relevant episodes. I am able to do each independently, but can't figure out how to bridge the two.
Right now my list of podcasts by author is generated using the iTunes App Store Search API. For example, you can request
#"term" : #"twit", #"media" : #"podcast"
and it will yield all the podcast channels by the author TWiT. It includes a lot of useful metadata via JSON, such as the title, artworkUrl, etc. But no direct link to the podcast that I can find.
I can also display a list of episodes for a specific podcast by parsing the iTunes RSS Tags from a hardcoded channel link that I extract by subscribing to said podcast in iTunes, then right-clicking on it and selecting Copy Podcast URL. TWiT again as an example would yield:
http://feeds.twit.tv/kh_video_hd.xml
Where this seems to fall apart is linking the two. I can't find a way to extract the direct podcast URL from the iTunes App Store JSON metadata.
I have seen the post on Finding the URL for podcast feeds from an iTunes id, but this seems to suggest you can only do it from the Apple supplied feeds from the iTunes Store RSS Generator. It is limited to predefined criteria (e.g. Top Podcasts).
Suggestions or clarifications would be appreciated. The only path I'm seeing right now is to hard code each of the Podcasts channels from my author list.
I think I've found the key. I'm not sure if this is universal, but in the podcasts I've tested with, the JSON results include a feedUrl parameter. Which frustratingly, is not mentioned on the Search API page.
feedUrl = "http://leoville.tv/podcasts/twit.xml";
Passing the value of this feedURL parameter pulled from the search API JSON results, and parsing it as RSS seems to deliver what I need.
Right Here.
"trackViewUrl":"https://itunes.apple.com/WebObjects/MZStore.woa/wa/viewAlbum?i=120954025&id=120954021&s=143441"
I think.
Related
I'm trying to import reviews for certain apps on the iTunes App Store via the public reviews RSS feed. Most of the time the feed returns a list of 50 reviews per page, and gives me links for up to 10 pages. But in the case of some apps, some or all of those pages have 0 reviews, and I can't tell why.
At the time of this writing, the feed for Instagram (link below) returns no reviews, despite reporting that there's 10 pages of reviews available.
https://itunes.apple.com/us/rss/customerreviews/page=1/id=389801252/sortBy=mostrecent/xml
Even more confusing, I noticed last night that page 2 had 50 reviews but none of the other pages had any. This morning, page 2 is empty again.
If I remove the sortBy=mostrecent portion of the URL above, I actually do get 50 results back, but none of the other pages have any results.
Finally, it appears as if the JSON version of this page (link below) actually returns results better than the XML version. Unfortunately, the JSON version leaves off the date of the review in the data so I can't use it.
https://itunes.apple.com/us/rss/customerreviews/page=1/id=389801252/sortBy=mostrecent/json
Can anyone explain this? Is Apple's XML feed API just extremely unreliable? Am I forming a bad URL?
While this answer isn't very satisfying, it's the best I could work out after many trials. It appears as if the XML feed is really fallible and shouldn't be used for real-world usage. Furthermore, when using the public JSON feed, certain fields such as review date are missing. Neither feed reports developer response.
It's also clear that Apple doesn't use these feeds for iTunes (desktop) or App Store (iOS). I ultimately reverse-engineered the way iTunes requests review data and figured out that making a request the same way, making sure to match their User Agent and version, would return the data I needed. These requests seem to be rate-limited to a certain extent and the data comes as a mix of HTML and JSON that requires a lot of parsing. Furthermore, because they're private calls, Apple could easily shut the door at any moment.
I was wondering if there is a list of available categories where videos can be uploaded to YouTube (programmatically, that is). I have found this but to be honest I don't know what part is supposed to be meaning.
See the documentation.
part can be either id or snippet (which includes the category names).
You also need to provide a regionCode (e.g. US) or the list of category IDs you want.
At the end of the documentation page there's a form where you can test it.
I'm working on a Rails app involving iTunes podcasts and I'd like to display a description for each podcast. But I cannot figure out a way to pull the description using the iTunes Search API. When I "lookup"/"search" by podcast ID, description is not one of the attributes. I'd be open to using another API to get podcast descriptions(something like Freebase for Wikipedia, for ex.), but searching by podcast title outside of the iTunes API is going to be tricky, given that some podcasts have general names like "Start Cooking." Any ideas? Thank you!
Using the lookup API - you can get some meta data for Podcasts but not all of it (as you noted). Here is an example of the lookup from an NPR Show:
http://itunes.apple.com/lookup?id=156274448
In the json response, you want to find the RSS feed URL that the Podcast provider maintains:
"feedUrl": "http://www.npr.org/rss/podcast.php?id=1056"
When you crawl the feed - the Podcast provider is responsible for providing the Description you are looking for:
<description><![CDATA[NPR's Foreign Desk picks the top story from the day's international coverage from Morning Edition,....</description>
Elaborating on Ted's answer above...
The original source of a description for a podcast is that podcast's rss feed.
It can be found within the <description> tag, which sits under the <channel> tag.
So, another option to get the description, instead of going to Apple to ask for it, could be to go directly to the source to get it. i.e. once you know the URL of the podcast rss feed, then you can parse it and get the value from the <description> tag.
Details on the official rss spec can be found here.
That is exactly what Apple and other podcast directories would be doing themselvs to get the description. It looks something like this...
I am trying to use the iTunes Affiliate Search API in my iPhone App to search for content within the iTunes Store. An example URL to search for "I Want To Hold Your Hand" is:
http://itunes.apple.com/search?term=i+want+to+hold+your+hand&entity=song
This search finds all songs with the title "I Want To Hold Your Hand". However, I only want to find the songs that are by The Beatles. I tried the following to narrow the search, but it did not work:
http://itunes.apple.com/search?term=i+want+to+hold+your+hand&entity=song&term=beatles&entity=musicartist
This just provides the same result.
How do you construct a URL to find a song title from specific artist using itunes.apple.com/search
Will you be happy with the results if you include "the beatles" into your search term?
http://itunes.apple.com/search?term=the+beatles+i+want+to+hold+your+hand&entity=song
If not, it seems you'll have to do some post processing to the results of the query.
YouTube has this cool thing that creates a "smart playlist" from some starting keywords. I would like to programmatically access the playlist. I've found the YouTube data API but it doesn't discuss the "disco" feature.
One of the answers below suggests using
http://www.youtube.com/disco?action_search=1&query=XXXXXXXXX
that will return some JSON with the first video to be played, and a list property. Unfortunately, the list is a 32-character hex string, whereas normal playlist ID's are 16-character hex strings. This means that the standard data API to retrieve the full playlist doesn't work.
Any suggestions?
First, I must say I I never used youtube data API, so I don't know how useful below information will be.
Let me use an example:
I wanted to create Smashing Pumpkins. I typed the artist name and clicked the "Disco!" button. Using Fiddler2 I figured out the requested url was:
www.youtube.com/disco?action_search=1&query=smashing%20pumpkins
Notice, that spaces are replaced with %20. As a response i got simple JSON response:
{"url": "\/watch?v=bhMz7x1ZaGM\u0026feature=disco\u0026playnext=1\u0026list=MLGxdCwVVULXe5-F4X_zm6wnblRsnXoPJS"}
It was a link to the first song of freshly generated Smashing Pumpkins playlist, which address was list=MLGxdCwVVULXe5-F4X_zm6wnblRsnXoPJS. All you have to do know is replacing \u0026 with & and you get a valid link.
I assume the rest magic you want to do is available via official youtube data API.
I hope my research will help you.
EDIT
Well, it looks like this playlist generated by youtube/disco is not the same type of playlist that users can generate and that is available via API. The list ID is longer than usuall and when you click "More info about playlist" you are redirected to artists profile. Based on this two facts, i guess it's impossible to retrive generated lists via API. Sorry.
#Randomblue, how exactly do you want to retrieve this playlist?
You can use the 32 char hex in this url to get a page detailing the playlist
https://www.youtube.com/playlist?list={HEX}
or in an embed playlist iframe, like this:
<iframe width="853" height="480" src="//www.youtube.com/embed/videoseries?list={HEX}" frameborder="0" allowfullscreen></iframe>