{"id":6258,"date":"2012-05-03T20:44:17","date_gmt":"2012-05-04T01:44:17","guid":{"rendered":"http:\/\/www.allyngibson.net\/?p=6258"},"modified":"2015-02-24T22:19:14","modified_gmt":"2015-02-24T22:19:14","slug":"on-coding-a-podcast-feed","status":"publish","type":"post","link":"http:\/\/www.allyngibson.com\/?p=6258","title":{"rendered":"On Coding a Podcast Feed"},"content":{"rendered":"<p>I returned today to a long-term project &mdash; my new website.<\/p>\n<p>On the train this morning, after writing out my daily office to-do list, I wrote down a list of the things that I had left to do for the site.  Design a logo here, design a graphic there, review content.php, <i>et cetera<\/i> and so forth.  All told, I wrote down eight items.<\/p>\n<p>One of those items?  &#8220;Custom RSS feed for iTunes.&#8221;<\/p>\n<p>I wrote <a href=\"http:\/\/www.allyngibson.com\/?p=6296\">back in January<\/a> that I was planning a podcast for my site, and I&#8217;ve written several scripts.  What&#8217;s odd about these scripts is that I&#8217;m happy with the scripts for episodes two and three, but the script for episode one I&#8217;m still unhappy with.  <a href=\"http:\/\/www.allyngibson.com\/?p=6341\">I&#8217;ve rewritten it<\/a>, then rewritten it again.<\/p>\n<p>To make a long story short, once I square <i>that<\/i> away, I would obviously want to get the podcast on iTunes.  But while WordPress does RSS out of the box (and can make a decent RSS feed for a podcast), Apple has some very <a href=\"http:\/\/www.apple.com\/itunes\/podcasts\/specs.html\">specific guidelines for what an iTunes RSS feed<\/a> needs to look like.  In short, a standard RSS2 feed isn&#8217;t up to snuff.<\/p>\n<p>While there&#8217;s a highly rated plugin that does the job &mdash; <a href=\"http:\/\/wordpress.org\/extend\/plugins\/podpress\/\">Podpress<\/a> &mdash; I wanted to do it on my own.<\/p>\n<p>Two hours of coding later, and I had a solution.<\/p>\n<p>I started out with this &mdash; <a href=\"http:\/\/digwp.com\/2009\/09\/easy-custom-feeds-in-wordpress\/\">page templates to create custom RSS feeds<\/a> &mdash; and from that I began to painstakingly build an RSS feed that generated iTunes code as defined by the <a href=\"http:\/\/www.apple.com\/itunes\/podcasts\/specs.html\">Apple guidelines<\/a>.<\/p>\n<p>It&#8217;s not <i>perfect<\/i> yet.  I still need to test it &mdash; I&#8217;m not sure about the WordPress query call, to be frank &mdash; but if it works (and I really don&#8217;t see why it wouldn&#8217;t) it&#8217;s a really <i>sweet<\/i> little piece of code. \ud83d\ude42<\/p>\n<p>Now I need to design some graphics.  But that can wait for the weekend.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I returned today to a long-term project &mdash; my new website. On the train this morning, after writing out my daily office to-do list, I wrote down a list of the things that I had left to do for the site. Design a logo here, design a graphic there, review content.php, et cetera and so<a class=\"more-link\" href=\"http:\/\/www.allyngibson.com\/?p=6258\">Continue reading <span class=\"screen-reader-text\">&#8220;On Coding a Podcast Feed&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4095],"tags":[173,4109,4096],"class_list":["post-6258","post","type-post","status-publish","format-standard","hentry","category-wordpress","tag-itunes","tag-podcast","tag-wordpress","entry"],"_links":{"self":[{"href":"http:\/\/www.allyngibson.com\/index.php?rest_route=\/wp\/v2\/posts\/6258","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.allyngibson.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.allyngibson.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.allyngibson.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.allyngibson.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6258"}],"version-history":[{"count":0,"href":"http:\/\/www.allyngibson.com\/index.php?rest_route=\/wp\/v2\/posts\/6258\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.allyngibson.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6258"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.allyngibson.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6258"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.allyngibson.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6258"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}