Access to iTunes Ratings Data - itunes

We want to write a Windows/OS X app that sends podcast ratings info from an iPod and iTunes back to a server. Two questions:
Is there documentation for how ratings data are stored in iTunes,
if a user has iTunes set to auto-delete programs he has heard, is there a way to capture the ratings data before it's gone?

I doubt there is an official spec on the data file format, but you can find rating info in the "iTunes Music Library.xml" file in the iTunes directory. Look for a key called "Rating" with an integer value from 0 to 100. It won't be there if the user hasn't rated the item. For example, a 4-star rating will have a value of 80.

itunes stores its Music Library data and Ratings in an XML file on the user's machine. In windows its located in the "Music" or "My Music" folder.
You can open the "iTunes Music Library.xml" file and look for the Rating element to see what the user rated each song. Since its XML, it's pretty self-explanatory. That should be pretty easy to open and parse from the program you're writing.
I think iTunes doesn't remove the podcasts from its xml file until the program is closed. You should be able to grab that rating data as long as itunes is still open.

In addition to the xml file, there is also a COM interface that will give you access to all of the library info, including the rating for each song. The SDK is documented.
I don't know what language you want to use, but I have used the C# to interface with iTunes and it was very smooth.
You can download the SDK at http://developer.apple.com/sdk/

Related

Streaming movies from my server

I'm playing around to make an app that lets people stream cartoons that I make. It's a very simple app, one ImageView is just loading in a html-homepage in a UIWebView. Witch contain links to .mov files. So if you tap them a movie will start playing. This is because I just want to update the html-file with new cartoons every week.
Is this an "ok" way to do things code:ing-wise? Or am i obligated to us some Objective-c streaming functions?
Is there a specific file-type that i have to use in the movie-files on the server?
Is the HTML static in your app, or does it point to a server? If it's the former, you may be able to get the app approved doing it the way you suggested, depending on the reviewer. If it's the latter, you're unlikely to get it approved by apple.
They tend to frown upon web sites bundled into apps, and will tell you to simply make your website usable with the phone. See section 2.12.
My suggestion is to spend a bit more time and offer iOS users a better - and more immersive - experience than is available via the web. As I'm sure you've found, there are many built-in ways to stream movies and to present them in a manner that surpasses a web-page-like experience.

Music database to run track data against

I'm writing an app that will let me manually edit my iTunes music library from outside of iTunes using a SQL-like syntax. I know how to edit the library, but I want to be able to run my track info against some kind of online database to get the right info. I found GraceNote, which seems to be the big name when it comes to music databases (iTunes actually uses it), but I'm not sure how to connect to their database. I registered into their developer program, but I'm not sure where to go from there. I just want to know where I can get a connection string and table info.
Have you tried Gracenote's Web API?
https://developer.gracenote.com/web-api
If you are creating an iOS or Android app, then you should use their Mobile Client SDK:
https://developer.gracenote.com/mobile-client

Determine the exact time for which my file has played

I want to calclute the duration for which my file has played...I am not sure what appoach to use.
Say for eample i have played an AV file on WMP and duration of the file is 30sec.now i want to checkh wether the file actually played for 30sec or less?
You can use some kind of timers in the programming language of the future implemenation.
Here are some samples of using it in C#:
dotnetperls: Timer
MSDN: Timer Class
and in Java:
asjava: Java Timer Tutorial
javarevisited.blogspot.de: Timer
You would have to implement a plug-in for every media player that you want to play your file on and detect the duration for which it was played. Different media players would have their own SDKs, plug-in APIs and the languages you can write the plug-in in.
For Windows Media Player you'll have to write a background plug-in (that exposes no visible user interface) in Microsoft Visual C++ using Visual Studio's WMP Plug-in wizard. Check out the relevant MSDN site for details.
What you're asking is similar to how Last.fm works. It's a music recommendation engine that installs Last.fm Scrobbler to scrobble (add to your online profile) the songs that you listen to on your media players. You can then access your account and see some interesting statistics like your Top Artists This Month.
But, what's relevant here is that a track gets scrobbled only when you've listened to more than half of it and the way it tracks the duration of play (along with the song, artist and album name) is through media player plug-ins. See Which media players are supported?

Get list of podcast subscriptions and downloaded AppStore applications from iTunes

So, I'm trying to implement a solution to a problem that I posted on superuser.
What I'm trying to do
I want to write a (Windows) application to synchronize podcast subscriptions in iTunes (and possibly iPhone/iPod touch apps, though I'll ignore them for now) between multiple computers that are using the same iTunes account.
How I'm planning on doing it
My initial thought was to do the following:
1) Grab the list of all podcast subscriptions from iTunes on computer A
2) Do some synching, giving new podcast urls to a program on computer B
3) Subscribe to the new podcasts in iTunes with computer B
I think I could do all this by parsing the ITL file, which is where subscription information seem to be stored. I haven't been able to find any documentation for this, though.
Maybe I'm going about this wrong and using the iTunes COM interface would be a decent way to grab the list of subscribed podcasts (step 1) and then subscribing to them (step 3). Is there a smarter way to go about doing this?
Summary
Before I reinvent the wheel, is there already a solution for synching podcast subscriptions among multiple computers?
What is the most appropriate method for grabbing a list of podcasts that iTunes is subscribed to?
What is the most appropriate method of subscribing iTunes to new podcasts?
As a note, I e-mailed Apple's Developer Support with pretty much the same questions, but apparently asking questions about documentation/API doesn't count as technical support.
Thanks,
On OS X there is no way to get iTunes' list of podcasts. You can ask for podcast tracks (and kind of arrange them by album name), but iTunes will not tell you anything about the actual podcasts themselves (URLs, status, name etc.).
I have zero experience of iTunes on Windows, but I'd be very surprised if the API were more comprehensive than the OS X one.

Get a list of iTunes podcasts available?

How can I get the RSS feed URL for the iTunes podcasts available? I want a feed which would list down all the podcasts present on iTunes. Is that possible?
Thanks.
There are a few options available these days:
iTunes RSS Feed Generator A list of the top 100 podcasts in RSS format, no authentication required.
iTunes Search API Apple has an API for all iTunes content including podcasts. JSON format, no authentication required, rate-limited to 20 calls per minute.
Enterprise Partner Feed Lets you download the entire iTunes database direct from Apple so you can perform unlimited searches from your own server. They provide an importer script to handle updating your database each day. You'll need to apply for a login to access the files.
As with many things Apple creates, a very limited set of functionality is exposed to third party developers. Currently, generating RSS feeds of podcasts in the iTunes Music Store does not appear to be supported. You can generate a limited set of RSS feeds for information in the iTunes store, but podcasts are not included.
You can generate these feeds using Apple's iTunes Music Store RSS Generator.
Furthermore, this really isn't the type of thing RSS is designed to do. The list of podcasts in iTunes is enormous, and wrapping each podcast in XML tags would create an even more enormous file. RSS is best used when you need to present a list of the most recent updates to something. Encoding the entire iTumes podcast catalog in RSS doesn't fit that catagory. You'll also notice that Apple's feed generator only allows you to create feeds of the few most recent or top songs, not the entire catalog.