access data of iTunes store programmatically

Discussion in 'Mac Programming' started by Howiieque, Aug 3, 2009.

  1. Howiieque macrumors regular

    Joined:
    Feb 1, 2009
    #1
    hello
    i want to write an cocoa application that displays the top 10 songs of iTunes store. Is there a way to achieve this goal? Is there any APIs can take this task? Or maybe other methods? Please help?
     
  2. lee1210 macrumors 68040

    lee1210

    Joined:
    Jan 10, 2005
    Location:
    Dallas, TX
    #2
    I'm sure lots of time has been spent "hacking" the XML that is returned from iTunes store pages, but one approach might be to use the RSS feeds that apple makes public (the generator is here: http://ax.itunes.apple.com/rss) then build on that. It may not be directly applicable, but I grabbed the top ten from the command line like this:
    Code:
    curl "http://ax.itunes.apple.com/WebObjects/MZStoreServices.woa/ws/RSS/topsongs/sf=143441/limit=10/explicit=true/xml" | grep "<title>" | awk -F[\<\>] '{print $3}'
    
    If you need more that what the RSS will provide you, you're going to have to read up on properly requesting and parsing the other iTunes pages, which I'm sure is subject to change with each iTunes release.

    -Lee
     
  3. Howiieque thread starter macrumors regular

    Joined:
    Feb 1, 2009

Share This Page