{
  "attachments": [],
  "comments_archived": true,
  "date": "2003-05-07T21:21:10.000Z",
  "layout": "post",
  "title": "iTunes Music Store RSS Feeds",
  "wordpress_id": 414,
  "wordpress_slug": "itunes-rss",
  "wordpress_url": "http://www.decafbad.com/blog/?p=414",
  "year": "2003",
  "month": "05",
  "day": "07",
  "isDir": false,
  "slug": "itunes-rss",
  "type": "entry",
  "postName": "2003-05-07-itunes-rss",
  "html": "<p>Yeah, I know I <a href=\"http://www.decafbad.com/blog/geek/itunes_does_drm.html\" target=\"_top\">gave the iTMS a 'bah'</a>\nlast week in response to discovering DRM under the hood.  But I've softened in\nmy opinion since then.  And bought a few more songs that I haven't heard in years.\nAnd burned an Audio CD.  And wasn't <strong>too</strong> inconvenienced.  </p>\n<p>My girlfriend and I almost\nbought iPods last night, and though we resisted the temptation this time, I expect that\nwe'll end up with them before long.  And when that happens, I imagine we'll try sharing\ntracks, and that doesn't seem to be too inconvenient either.  And then, there's the\nfact that the iTMS seems to have a pretty nifty set of underpinnings that look like\nfun to play with.</p>\n<p>So now, like anything I'm interested in on the interweb, I want to swallow it up with my aggregator.</p>\n<p>Thus, I attempt a new project:  <a href=\"http://www.decafbad.com/twiki/bin/view/Main/ItunesMusicStoreToRss\">ItunesMusicStoreToRss</a></p>\n<p>Progress so far, but I've hit a stumbling block.  Anyone want to help?</p>\n<p><strong>Update:</strong> A little bit of cut &amp; paste from the wiki page:</p>\n<p>If you spy on iTunes while browsing to a \"Just Added\" section of a genre, you'll find that a URL like the following is accessed: </p>\n<p><a href=\"http://ax.phobos.apple.com.edgesuite.net/WebObjects/MZStore.woa/wa/com.apple.jingle.app.store.DirectAction/viewPlayListsPage?fcId=145690&amp;pageType=justAdded&amp;id=21\" target=\"_top\">(it's a long URL)</a></p>\n<p>The response to that URL is some very interesting XML that looks like a GUI language.  Buried in the GUI recipe, however, is what I want flowing into my aggregator.  So, I dust off my XSL skills and have a go at mangling this content into <a href=\"http://www.decafbad.com/twiki/bin/view/Main/RSS\">RSS</a>.  I seem to have been successful.  A test run appears to validate, and is accepted in my aggregator. </p>\n<p>The problem, though, lies in the aforementioned URL.  Everything seems pretty clear and straightforward, and I can change genre's by supplying discovered ID's to the id parameter.  However, the  \"fcid=145690\" parameter  is an unknown to me.  It seems to change, though I haven't yet investigated its derivation or how often it changes.  I was working on things yesterday, and the value was one thing, this morning it was another. If the number is not valid, unexpected results happen, sometimes resulting in HTML output describing an application exception.  So, until the fcid mystery is solved, I've yet to automate this transformation. </p>\n<p>Any ideas out there on the lazyweb?  Visit the wiki page (<a href=\"http://www.decafbad.com/twiki/bin/view/Main/ItunesMusicStoreToRss\">ItunesMusicStoreToRss</a>) and feel free to poke fun at my XSL skills.</p>\n<!--more-->\n\n\n<p>shortname=itunes_rss</p>\n<div id=\"comments\" class=\"comments archived-comments\"><h3>Archived Comments</h3>\n<ul class=\"comments\">\n<li class=\"comment\" id=\"comment-221090443\">\n<div class=\"meta\">\n<div class=\"author\">\n<a class=\"avatar image\" rel=\"nofollow\" href=\"http://www.scifihifi.com\"><img src=\"http://www.gravatar.com/avatar.php?gravatar_id=a97f3ecb15bebb41d330c6e27457378f&amp;size=32&amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png\" width=\"\" height=\"\"></a>\n<a class=\"avatar name\" rel=\"nofollow\" href=\"http://www.scifihifi.com\">Buzz Andersen</a>\n</div>\n\n\n<p><a href=\"#comment-221090443\" class=\"permalink\"><time datetime=\"2003-05-07T16:30:16\">2003-05-07T16:30:16</time></a></p>\n</div>\n\n\n<div class=\"content\">What seems to be the problem?</div>\n\n\n</li>\n<li class=\"comment\" id=\"comment-221090444\">\n<div class=\"meta\">\n<div class=\"author\">\n<a class=\"avatar image\" rel=\"nofollow\" href=\"http://www.decafbad.com\"><img src=\"http://www.gravatar.com/avatar.php?gravatar_id=2ac2cffd36ada8c734b90e02a1e5c1ac&amp;size=32&amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png\" width=\"\" height=\"\"></a>\n<a class=\"avatar name\" rel=\"nofollow\" href=\"http://www.decafbad.com\">l.m.orchard</a>\n</div>\n\n\n<p><a href=\"#comment-221090444\" class=\"permalink\"><time datetime=\"2003-05-07T17:22:19\">2003-05-07T17:22:19</time></a></p>\n</div>\n\n\n<div class=\"content\">Oh, it's rambled about on the wiki page.  I just updated the blog entry with more info though.  Seems there's a parameter (fcid) to the URL for just added albums that I can't decipher.</div>\n\n\n</li>\n<li class=\"comment\" id=\"comment-221090445\">\n<div class=\"meta\">\n<div class=\"author\">\n<a class=\"avatar image\" rel=\"nofollow\" href=\"http://www.scifihifi.com\"><img src=\"http://www.gravatar.com/avatar.php?gravatar_id=a97f3ecb15bebb41d330c6e27457378f&amp;size=32&amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png\" width=\"\" height=\"\"></a>\n<a class=\"avatar name\" rel=\"nofollow\" href=\"http://www.scifihifi.com\">Buzz Andersen</a>\n</div>\n\n\n<p><a href=\"#comment-221090445\" class=\"permalink\"><time datetime=\"2003-05-07T19:07:37\">2003-05-07T19:07:37</time></a></p>\n</div>\n\n\n<div class=\"content\">Sorry--I'm not hip to the whole Wiki thing yet.  I'll take a look over there...</div>\n\n\n</li>\n<li class=\"comment\" id=\"comment-221090446\">\n<div class=\"meta\">\n<div class=\"author\">\n<a class=\"avatar image\" rel=\"nofollow\" href=\"\"><img src=\"http://www.gravatar.com/avatar.php?gravatar_id=190370de043f10f2760322e8902b137c&amp;size=32&amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png\" width=\"\" height=\"\"></a>\n<a class=\"avatar name\" rel=\"nofollow\" href=\"\">Nathan Pearson</a>\n</div>\n\n\n<p><a href=\"#comment-221090446\" class=\"permalink\"><time datetime=\"2003-05-08T04:17:54\">2003-05-08T04:17:54</time></a></p>\n</div>\n\n\n<div class=\"content\">I imagine fcId is tied to an internal value that's changed by a content management system.  Even if it changes a few times in a noticeable pattern, I don't imagine that it would be reliable forever.  The only foolproof way I can think of retrieving the contents of a (or all of them) Just Added 'playlist' is by doing the following;\n1. Retrieving the XML from viewPlaylistsPage without any parameters and storing the attribute of the ViewGenre element that matches your preferred genre(s).  I don't imagine these would remain static for all time either, judging from the numbers;\n2. For each genre id that was stored from step 1, load the XML from vewGenre?id=.  Find the GotoURL element that contains the text Just Added and grab it's url attribute.  Add on &amp;batchNumber=0;\n3. If you're fine with just one page being transformed, use the resulting XML for the transformation to RSS.  Otherwise, store the album information that you want to keep from the page and look for the value 'X-Y of Z'.  If Y and Z don't match, increment batchNumber and process the resulting XML.  Repeat for other genres.\nIt'd probably be best to cache the resulting RSS feed and let it live for at least 24 hours.  With at least three to four round trips to determine the albums in a playlist without knowledge of the fcId values, I don't imagine it would be very responsive.</div>\n\n\n</li>\n<li class=\"comment\" id=\"comment-221090447\">\n<div class=\"meta\">\n<div class=\"author\">\n<a class=\"avatar image\" rel=\"nofollow\" href=\"http://www.decafbad.com\"><img src=\"http://www.gravatar.com/avatar.php?gravatar_id=2ac2cffd36ada8c734b90e02a1e5c1ac&amp;size=32&amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png\" width=\"\" height=\"\"></a>\n<a class=\"avatar name\" rel=\"nofollow\" href=\"http://www.decafbad.com\">l.m.orchard</a>\n</div>\n\n\n<p><a href=\"#comment-221090447\" class=\"permalink\"><time datetime=\"2003-05-08T15:46:01\">2003-05-08T15:46:01</time></a></p>\n</div>\n\n\n<div class=\"content\">Nathan: Hrm...  Yeah, that's the approach I was afraid that I'd have to end up taking, but it's probably the most reliable.  Hmph.</div>\n\n\n</li>\n</ul>\n\n\n</div>\n\n\n",
  "body": "Yeah, I know I <a href=\"http://www.decafbad.com/blog/geek/itunes_does_drm.html\" target=\"_top\">gave the iTMS a 'bah'</a>\r\nlast week in response to discovering DRM under the hood.  But I've softened in\r\nmy opinion since then.  And bought a few more songs that I haven't heard in years.\r\nAnd burned an Audio CD.  And wasn't <strong>too</strong> inconvenienced.  \r\n<br /><br />\r\nMy girlfriend and I almost\r\nbought iPods last night, and though we resisted the temptation this time, I expect that\r\nwe'll end up with them before long.  And when that happens, I imagine we'll try sharing\r\ntracks, and that doesn't seem to be too inconvenient either.  And then, there's the\r\nfact that the iTMS seems to have a pretty nifty set of underpinnings that look like\r\nfun to play with.\r\n<br /><br />\r\nSo now, like anything I'm interested in on the interweb, I want to swallow it up with my aggregator.\r\n<br /><br />\r\nThus, I attempt a new project:  <a href=\"http://www.decafbad.com/twiki/bin/view/Main/ItunesMusicStoreToRss\">ItunesMusicStoreToRss</a>\r\n<br /><br />\r\nProgress so far, but I've hit a stumbling block.  Anyone want to help?\r\n<br /><br />\r\n<strong>Update:</strong> A little bit of cut &amp; paste from the wiki page:\r\n<br /><br />\r\nIf you spy on iTunes while browsing to a \"Just Added\" section of a genre, you'll find that a URL like the following is accessed: \r\n<br /><br />\r\n<a href=\"http://ax.phobos.apple.com.edgesuite.net/WebObjects/MZStore.woa/wa/com.apple.jingle.app.store.DirectAction/viewPlayListsPage?fcId=145690&amp;pageType=justAdded&amp;id=21\" target=\"_top\">(it's a long URL)</a>\r\n<br /><br />\r\nThe response to that URL is some very interesting XML that looks like a GUI language.  Buried in the GUI recipe, however, is what I want flowing into my aggregator.  So, I dust off my XSL skills and have a go at mangling this content into <a href=\"http://www.decafbad.com/twiki/bin/view/Main/RSS\">RSS</a>.  I seem to have been successful.  A test run appears to validate, and is accepted in my aggregator. \r\n<br /><br />\r\nThe problem, though, lies in the aforementioned URL.  Everything seems pretty clear and straightforward, and I can change genre's by supplying discovered ID's to the id parameter.  However, the  \"fcid=145690\" parameter  is an unknown to me.  It seems to change, though I haven't yet investigated its derivation or how often it changes.  I was working on things yesterday, and the value was one thing, this morning it was another. If the number is not valid, unexpected results happen, sometimes resulting in HTML output describing an application exception.  So, until the fcid mystery is solved, I've yet to automate this transformation. \r\n<br /><br />\r\nAny ideas out there on the lazyweb?  Visit the wiki page (<a href=\"http://www.decafbad.com/twiki/bin/view/Main/ItunesMusicStoreToRss\">ItunesMusicStoreToRss</a>) and feel free to poke fun at my XSL skills.\r\n<!--more-->\r\nshortname=itunes_rss\r\n\r\n<div id=\"comments\" class=\"comments archived-comments\">\r\n            <h3>Archived Comments</h3>\r\n            \r\n        <ul class=\"comments\">\r\n            \r\n        <li class=\"comment\" id=\"comment-221090443\">\r\n            <div class=\"meta\">\r\n                <div class=\"author\">\r\n                    <a class=\"avatar image\" rel=\"nofollow\" \r\n                       href=\"http://www.scifihifi.com\"><img src=\"http://www.gravatar.com/avatar.php?gravatar_id=a97f3ecb15bebb41d330c6e27457378f&amp;size=32&amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png\"/></a>\r\n                    <a class=\"avatar name\" rel=\"nofollow\" \r\n                       href=\"http://www.scifihifi.com\">Buzz Andersen</a>\r\n                </div>\r\n                <a href=\"#comment-221090443\" class=\"permalink\"><time datetime=\"2003-05-07T16:30:16\">2003-05-07T16:30:16</time></a>\r\n            </div>\r\n            <div class=\"content\">What seems to be the problem?</div>\r\n            \r\n        </li>\r\n    \r\n        <li class=\"comment\" id=\"comment-221090444\">\r\n            <div class=\"meta\">\r\n                <div class=\"author\">\r\n                    <a class=\"avatar image\" rel=\"nofollow\" \r\n                       href=\"http://www.decafbad.com\"><img src=\"http://www.gravatar.com/avatar.php?gravatar_id=2ac2cffd36ada8c734b90e02a1e5c1ac&amp;size=32&amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png\"/></a>\r\n                    <a class=\"avatar name\" rel=\"nofollow\" \r\n                       href=\"http://www.decafbad.com\">l.m.orchard</a>\r\n                </div>\r\n                <a href=\"#comment-221090444\" class=\"permalink\"><time datetime=\"2003-05-07T17:22:19\">2003-05-07T17:22:19</time></a>\r\n            </div>\r\n            <div class=\"content\">Oh, it's rambled about on the wiki page.  I just updated the blog entry with more info though.  Seems there's a parameter (fcid) to the URL for just added albums that I can't decipher.</div>\r\n            \r\n        </li>\r\n    \r\n        <li class=\"comment\" id=\"comment-221090445\">\r\n            <div class=\"meta\">\r\n                <div class=\"author\">\r\n                    <a class=\"avatar image\" rel=\"nofollow\" \r\n                       href=\"http://www.scifihifi.com\"><img src=\"http://www.gravatar.com/avatar.php?gravatar_id=a97f3ecb15bebb41d330c6e27457378f&amp;size=32&amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png\"/></a>\r\n                    <a class=\"avatar name\" rel=\"nofollow\" \r\n                       href=\"http://www.scifihifi.com\">Buzz Andersen</a>\r\n                </div>\r\n                <a href=\"#comment-221090445\" class=\"permalink\"><time datetime=\"2003-05-07T19:07:37\">2003-05-07T19:07:37</time></a>\r\n            </div>\r\n            <div class=\"content\">Sorry--I'm not hip to the whole Wiki thing yet.  I'll take a look over there...</div>\r\n            \r\n        </li>\r\n    \r\n        <li class=\"comment\" id=\"comment-221090446\">\r\n            <div class=\"meta\">\r\n                <div class=\"author\">\r\n                    <a class=\"avatar image\" rel=\"nofollow\" \r\n                       href=\"\"><img src=\"http://www.gravatar.com/avatar.php?gravatar_id=190370de043f10f2760322e8902b137c&amp;size=32&amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png\"/></a>\r\n                    <a class=\"avatar name\" rel=\"nofollow\" \r\n                       href=\"\">Nathan Pearson</a>\r\n                </div>\r\n                <a href=\"#comment-221090446\" class=\"permalink\"><time datetime=\"2003-05-08T04:17:54\">2003-05-08T04:17:54</time></a>\r\n            </div>\r\n            <div class=\"content\">I imagine fcId is tied to an internal value that's changed by a content management system.  Even if it changes a few times in a noticeable pattern, I don't imagine that it would be reliable forever.  The only foolproof way I can think of retrieving the contents of a (or all of them) Just Added 'playlist' is by doing the following;\r\n\r\n1. Retrieving the XML from viewPlaylistsPage without any parameters and storing the attribute of the ViewGenre element that matches your preferred genre(s).  I don't imagine these would remain static for all time either, judging from the numbers;\r\n\r\n2. For each genre id that was stored from step 1, load the XML from vewGenre?id=.  Find the GotoURL element that contains the text Just Added and grab it's url attribute.  Add on &batchNumber=0;\r\n\r\n3. If you're fine with just one page being transformed, use the resulting XML for the transformation to RSS.  Otherwise, store the album information that you want to keep from the page and look for the value 'X-Y of Z'.  If Y and Z don't match, increment batchNumber and process the resulting XML.  Repeat for other genres.\r\n\r\nIt'd probably be best to cache the resulting RSS feed and let it live for at least 24 hours.  With at least three to four round trips to determine the albums in a playlist without knowledge of the fcId values, I don't imagine it would be very responsive.</div>\r\n            \r\n        </li>\r\n    \r\n        <li class=\"comment\" id=\"comment-221090447\">\r\n            <div class=\"meta\">\r\n                <div class=\"author\">\r\n                    <a class=\"avatar image\" rel=\"nofollow\" \r\n                       href=\"http://www.decafbad.com\"><img src=\"http://www.gravatar.com/avatar.php?gravatar_id=2ac2cffd36ada8c734b90e02a1e5c1ac&amp;size=32&amp;default=http://mediacdn.disqus.com/1320279820/images/noavatar32.png\"/></a>\r\n                    <a class=\"avatar name\" rel=\"nofollow\" \r\n                       href=\"http://www.decafbad.com\">l.m.orchard</a>\r\n                </div>\r\n                <a href=\"#comment-221090447\" class=\"permalink\"><time datetime=\"2003-05-08T15:46:01\">2003-05-08T15:46:01</time></a>\r\n            </div>\r\n            <div class=\"content\">Nathan: Hrm...  Yeah, that's the approach I was afraid that I'd have to end up taking, but it's probably the most reliable.  Hmph.</div>\r\n            \r\n        </li>\r\n    \r\n        </ul>\r\n    \r\n        </div>\r\n    ",
  "parentPath": "./content/posts/archives/2003",
  "path": "2003/05/07/itunes-rss",
  "summary": "Yeah, I know I gave the iTMS a 'bah'\nlast week in response to discovering DRM under the hood.  But I've softened in\nmy opinion since then.  And bought a few more songs that I haven't heard in years.\nAnd burned an Audio CD.  And wasn't too inconvenienced.  \nMy girlfriend and I almost\nbought iPods last night, and though we resisted the temptation this time, I expect that\nwe'll end up with them before long.  And when that happens, I imagine we'll try sharing\ntracks, and that doesn't seem to be too inconvenient either.  And then, there's the\nfact that the iTMS seems to have a pretty nifty set of underpinnings that look like\nfun to play with.\nSo now, like anything I'm interested in on the interweb, I want to swallow it up with my aggregator.\nThus, I attempt a new project:  ItunesMusicStoreToRss\nProgress so far, but I've hit a stumbling block.  Anyone want to help?\nUpdate: A little bit of cut & paste from the wiki page:\nIf you spy on iTunes while browsing to a \"Just Added\" section of a genre, you'll find that a URL like the following is accessed: \n(it's a long URL)\nThe response to that URL is some very interesting XML that looks like a GUI language.  Buried in the GUI recipe, however, is what I want flowing into my aggregator.  So, I dust off my XSL skills and have a go at mangling this content into RSS.  I seem to have been successful.  A test run appears to validate, and is accepted in my aggregator. \nThe problem, though, lies in the aforementioned URL.  Everything seems pretty clear and straightforward, and I can change genre's by supplying discovered ID's to the id parameter.  However, the  \"fcid=145690\" parameter  is an unknown to me.  It seems to change, though I haven't yet investigated its derivation or how often it changes.  I was working on things yesterday, and the value was one thing, this morning it was another. If the number is not valid, unexpected results happen, sometimes resulting in HTML output describing an application exception.  So, until the fcid mystery is solved, I've yet to automate this transformation. \nAny ideas out there on the lazyweb?  Visit the wiki page (ItunesMusicStoreToRss) and feel free to poke fun at my XSL skills.",
  "needsBuild": true,
  "prevPostPath": "2003/04/30/strange-component-error",
  "prevPostTitle": "Getting a Strange \"Component Manager\" Message Under OS X?",
  "nextPostPath": "2003/05/08/rssbayes-now",
  "nextPostTitle": "Bayesian Filtering for what I DO want?"
}