Brian Ritchie's Blog

My ramblings on .NET & other development topics

News



Twitter

Blog Roll

Connect with me

Creating a podcast feed for iTunes & BlackBerry users using WCF Syndication

 In my previous post, I showed how to create a RSS feed using WCF Syndication.  Next, I'll show how to add the additional tags needed to turn a RSS feed into an iTunes podcast. 

 A podcast is merely a RSS feed with some special characteristics:

  • iTunes RSS tags.  These are additional tags beyond the standard RSS spec.  Apple has a good page on the requirements.
  • Audio file enclosure.  This is a link to the audio file (such as mp3) hosted by your site.  Apple doesn't host the audio, they just read the meta-data from the RSS feed into their system.

The SyndicationFeed class supports both AttributeExtensions & ElementExtensions to add custom tags to the RSS feeds.

A couple of points of interest in the code below:

  • The imageUrl below provides the album cover for iTunes (170px × 170px)
  • Each SyndicationItem corresponds to an audio episode in your podcast

So, here's the code:

   1:  XNamespace itunesNS = "http://www.itunes.com/dtds/podcast-1.0.dtd";
   2:  string prefix = "itunes";
   3:   
   4:  var feed = new SyndicationFeed(title, description, new Uri(link));
   5:  feed.Categories.Add(new SyndicationCategory(category));
   6:  feed.AttributeExtensions.Add(new XmlQualifiedName(prefix, 
   7:     "http://www.w3.org/2000/xmlns/"), itunesNS.NamespaceName);
   8:  feed.Copyright = new TextSyndicationContent(copyright);
   9:  feed.Language = "en-us";
  10:  feed.Copyright = new TextSyndicationContent(DateTime.Now.Year + " " + ownerName);
  11:  feed.ImageUrl = new Uri(imageUrl);
  12:  feed.LastUpdatedTime = DateTime.Now;
  13:  feed.Authors.Add(new SyndicationPerson() {Name=ownerName, Email=ownerEmail });
  14:  var extensions = feed.ElementExtensions;
  15:  extensions.Add(new XElement(itunesNS + "subtitle", subTitle).CreateReader());
  16:  extensions.Add(new XElement(itunesNS + "image", 
  17:      new XAttribute("href", imageUrl)).CreateReader());
  18:  extensions.Add(new XElement(itunesNS + "author", ownerName).CreateReader());
  19:  extensions.Add(new XElement(itunesNS + "summary", description).CreateReader());
  20:  extensions.Add(new XElement(itunesNS + "category", 
  21:      new XAttribute("text", category),
  22:      new XElement(itunesNS + "category", 
  23:             new XAttribute("text", subCategory))).CreateReader());
  24:  extensions.Add(new XElement(itunesNS + "explicit", "no").CreateReader());
  25:  extensions.Add(new XDocument(
  26:          new XElement(itunesNS + "owner",
  27:          new XElement(itunesNS + "name", ownerName),
  28:          new XElement(itunesNS + "email", ownerEmail))).CreateReader());
  29:   
  30:  var feedItems = new List<SyndicationItem>();
  31:  foreach (var i in Items)
  32:  {
  33:      var item = new SyndicationItem(i.title, null, new Uri(link));
  34:      item.Summary = new TextSyndicationContent(i.summary);
  35:      item.Id = i.id;
  36:      if (i.publishedDate != null)
  37:          item.PublishDate = (DateTimeOffset)i.publishedDate;
  38:      item.Links.Add(new SyndicationLink() { 
  39:           Title = i.title, Uri = new Uri(link), 
  40:           Length = i.size, MediaType = i.mediaType });
  41:      var itemExt = item.ElementExtensions;
  42:      itemExt.Add(new XElement(itunesNS + "subtitle", i.subTitle).CreateReader());
  43:      itemExt.Add(new XElement(itunesNS + "summary", i.summary).CreateReader());
  44:      itemExt.Add(new XElement(itunesNS + "duration", 
  45:      string.Format("{0}:{1:00}:{2:00}", 
  46:          i.duration.Hours, i.duration.Minutes, i.duration.Seconds)
  47:         ).CreateReader());
  48:      itemExt.Add(new XElement(itunesNS + "keywords", i.keywords).CreateReader());
  49:      itemExt.Add(new XElement(itunesNS + "explicit", "no").CreateReader());
  50:      itemExt.Add(new XElement("enclosure", new XAttribute("url", i.url), 
  51:          new XAttribute("length", i.size), new XAttribute("type", i.mediaType)));
  52:      feedItems.Add(item);
  53:  }
  54:   
  55:  feed.Items = feedItems;

If you're hosting your podcast feed within a MVC project, you can use the code from my previous post to stream it.

Once you have created your feed, you can use the Feed Validator tool to make sure it is up to spec.  Or you can use iTunes:

  1. Launch iTunes.
  2. In the Advanced menu, select Subscribe to Podcast.
  3. Enter your feed URL in the text box and click OK.

After you've verified your feed is solid & good to go, you can submit it to iTunes. 

  1. Launch iTunes.
  2. In the left navigation column, click on iTunes Store to open the store.
  3. Once the store loads, click on Podcasts along the top navigation bar to go to the Podcasts page.
  4. In the right column of the Podcasts page, click on the Submit a Podcast link.
  5. Follow the instructions on the Submit a Podcast page.

Here are the full instructions.  Once they have approved your podcast, it will be available within iTunes.

RIM has also gotten into the podcasting business...which is great for BlackBerry users.  They accept the same enhanced-RSS feed that iTunes uses, so just create an account with them & submit the feed's URL.  It goes through a similar approval process to iTunes.  BlackBerry users must be on BlackBerry 6 OS or download the Podcast App from App World.

In my next post, I'll show how to build the podcast feed dynamically from the ID3 tags within the MP3 files.



Posted: Feb 27 2011, 10:32 PM by brian_ritchie | with 42 comment(s)
Filed under: , , ,

Comments

Advanced Flv Player said:

iTunes RSS Tags works great with its additional Tags! Thanks for the code reference, really helpful.......... I am awaiting for your next post on "how to build the podcast feed dynamically from the ID3 tags within the MP3 files."

# February 28, 2011 2:15 AM

Creating a podcast feed for iTunes & BlackBerry users using WCF … said:

Pingback from  Creating a podcast feed for iTunes &amp; BlackBerry users using WCF &#8230;

# February 28, 2011 4:22 AM

ITunes Apps » Creating a podcast feed for iTunes & BlackBerry users using WCF … said:

Pingback from  ITunes Apps &raquo; Creating a podcast feed for iTunes &amp; BlackBerry users using WCF &#8230;

# February 28, 2011 5:11 AM

Brian Ritchie's Blog said:

In the last post , I showed how to create a podcast using WCF syndication. A podcast is an RSS feed containing

# February 28, 2011 11:37 PM

Populate a WCF syndication podcast using MP3 ID3 metadata tags said:

Pingback from  Populate a WCF syndication podcast using MP3 ID3 metadata tags

# March 1, 2011 7:20 AM

Keyvan Nayyeri said:

Trackback from How to Create a Podcast RSS Feed in .NET.

# July 4, 2011 5:09 PM

Keyvan Nayyeri said:

Trackback from How to Create a Podcast RSS Feed in .NET.

# February 24, 2012 9:47 PM

Keyvan Nayyeri said:

Trackback from How to Create a Podcast RSS Feed in .NET.

# March 27, 2012 12:47 AM

icon said:

P.S. Please review our <a href="http://android.militarydesign.biz">design portfolio</a> for Doors2012.

Website Branding Through Graphic Design

A great web design is not just about using attractive colours and putting together the navigation mensu. Rather, it is about branding the website in a way that it attracts the targeted audience. While graphic design is all about visual appeal, it should also put across a message to the visitors. By incorporating the principles of graphic design in your web design, you have to form a unique identity that your visitors and customers can relate to and recognise easily.Many web designers often make the mistake of overusing or misusing graphic images on the website. Too much of graphic design makes the website look cluttered and too little or dull graphic images can make the site look bland. The trick is to use graphic design throughout the website in measured proportions. Some of the areas where graphic images and design can be used on a website include corporate logos, navigation buttons, mastheads and footers, image maps, bullet points, background images, photos and image maps. All these areas on the website have to be designed in a way that it leaves a lasting impression on the minds of the visitors.Some of the graphic design elements that must be added to a web design are discussed below:Website colours: The purposee of investing in graphic design services while building a website is to gain a competitive edge and attract more visitors. Colours play a huge role in catching the attention, and during web design, it should be given high priority. The graphic designer should choose colours that complement the industry that you are targeting. For example, if your website is about women's apparel, the colours should be selected from the palettes of pinks, reds and purples that appeal to the female sensibility. Thus, it is important to choose right colours and blend them with the theme of the website.Typography: The fonts used throughout the web design have to be addressed by a graphic designer. The different fonts used in the websitee should not only complement each other but also the content on each of the web pages. The typography has to make the content appealinjg and readable. It is advisable that you choose familiar fonts that add a unifying element to the web design.Social media integration: One needs to blend the links to the social media profiles of a company with its website. Just by placing social media icons on your website does not bring effective results. To give your site a distinct edge, you can blend the social media icons with the colours and theme of the website by customising them.When you incorporate these elements of graphic design to your web design, the site is sure to rise above the rest and get a distinctive identity on the Internet. Through website branding, you stand a chance of getting higher visitors, enhancing the conversion rate, leads, sales and revenue. In Sydney, you can find several web designers and graphic designers who have an expertise in both the domains and cna help in building a website that is not only visually appealing but also enhances the user experience.

# December 13, 2012 11:38 PM

Franks said:

Quality articles or reviews is the important to invite the

users to pay a quick visit the website, that's what this website is providing.

# January 4, 2013 2:45 PM

Lopes said:

Every weekend i used to visit this web page, as i wish for enjoyment,

as this this web page conations truly nice funny material too.

# January 4, 2013 11:15 PM

Monahan said:

Hi there, just wanted to mention, I liked this post.

It was practical. Keep on posting!

# January 7, 2013 9:12 AM

Colwell said:

My family always say that I am wasting my time here at

net, however I know I am getting familiarity daily by reading thes pleasant articles.

# January 8, 2013 6:17 AM

Rees said:

3. This day, minimum of 100 lamps and maximum of 1 lakh lamps are lighted.

The white elephant gift exchange idea spread, and now it's a much-loved way of possessing an extremely very good time with other people.

# January 8, 2013 12:40 PM

Halverson said:

Whatever we have that isn't broken goes up there. This day, minimum of 100 lamps and maximum of 1 lakh lamps are lighted. The oranges aren't really suited

to eating - it's more like you are drinking fruit than eating it, way too juicy.

# January 10, 2013 6:28 AM

Sawyers said:

# January 11, 2013 4:27 PM

Bisson said:

# January 12, 2013 1:57 AM

Fort said:

# January 12, 2013 2:27 AM

Costello said:

# January 12, 2013 7:42 AM

Cantrell said:

Hello my loved one! I wish to say that this post is awesome,

nice written and include approximately all vital infos.

I'd like to peer extra posts like this .

# January 21, 2013 3:47 AM

Sosa said:

Wow! In the end I got a weblog from where I know how to genuinely obtain helpful information

regarding my study and knowledge.

# January 21, 2013 3:22 PM

Blanks said:

Nice post. I learn something totally new and challenging on sites I stumbleupon everyday.

It's always interesting to read content from other authors and practice a little something from their websites.

# January 21, 2013 4:09 PM

March said:

Keep on working, great job!

# January 21, 2013 4:25 PM

Prescott said:

We stumbled over here by a different page and thought I might as well check things

out. I like what I see so now i'm following you. Look forward to going over your web page for a second time.

# January 21, 2013 4:49 PM

Reynoso said:

Very shortly this website will be famous among all blog people, due

to it's fastidious articles or reviews

# January 21, 2013 4:56 PM

Chalmers said:

I don't drop a ton of responses, however i did a few searching and wound up here Creating a podcast feed for iTunes & BlackBerry users using WCF Syndication - Brian Ritchie's Blog.

And I do have 2 questions for you if it's allright. Is it simply me or does it seem like some of the responses come across like written by brain dead visitors? :-P And, if you are writing at other sites, I'd like to follow anything new you have to post.

Could you list of every one of all your communal sites like your twitter feed, Facebook page or linkedin profile?

# January 23, 2013 2:36 AM

Higdon said:

I really like what you guys are up too. This kind of clever work and reporting!

Keep up the fantastic works guys I've added you guys to my own blogroll.

# January 26, 2013 11:19 PM

Kimbrell said:

Heya i'm for the first time here. I came across this board and I find It really useful & it helped me out a lot. I hope to give something back and aid others like you aided me.

# January 27, 2013 9:42 AM

Hanlon said:

I don't know whether it's just me or if everyone else experiencing problems with

your website. It appears like some of the written text on your content are running off the screen.

Can somebody else please comment and let me know

if this is happening to them as well? This may be a issue

with my internet browser because I've had this happen before. Thank you

# January 27, 2013 9:45 AM

Gabbard said:

I don't even know the way I stopped up here, however I believed this post used to be great. I don't realize who you're but definitely you are going to a well-known blogger when you aren't already.

Cheers!

# January 27, 2013 6:08 PM

Harry said:

Hey I know this is off topic but I was wondering if you knew of

any widgets I could add to my blog that automatically tweet my newest twitter updates.

I've been looking for a plug-in like this for quite some time and was hoping maybe you would have some experience with something like this. Please let me know if you run into anything. I truly enjoy reading your blog and I look forward to your new updates.

# February 14, 2013 2:50 PM

Battaglia said:

Oh my goodness! Amazing article dude! Thank

you so much, However I am going through difficulties with your

RSS. I don't know the reason why I can't subscribe to it.

Is there anybody having identical RSS issues? Anyone who knows the solution

will you kindly respond? Thanx!!

# February 26, 2013 4:20 PM

Mccue said:

Every weekend i used to go to see this web site,

because i want enjoyment, as this this website conations actually pleasant funny data too.

# February 26, 2013 6:38 PM

Curry said:

I'm not sure exactly why but this site is loading very slow for me. Is anyone else having this issue or is it a problem on my end? I'll check back later on and see if the problem still exists.

# February 26, 2013 6:46 PM

Jameson said:

This web site definitely has all of the information I needed about this

subject and didn't know who to ask.

# February 27, 2013 8:50 AM

Betancourt said:

Hi, all is going sound here and ofcourse every one

is sharing facts, that's in fact good, keep up writing.

# March 3, 2013 8:27 AM

Xiong said:

Wow that was strange. I just wrote an very long comment but after I clicked

submit my comment didn't appear. Grrrr... well I'm not writing all that over again.

Anyhow, just wanted to say superb blog!

# March 4, 2013 1:39 AM

Henry said:

It's hard to come by experienced people in this particular subject, but you seem like you know what you're talking

about! Thanks

# March 4, 2013 5:08 PM

Mckay said:

This is my first time go to see at here and i am really pleassant to read all at alone place.

# March 7, 2013 12:23 AM

Cantwell said:

Hello, I enjoy reading all of your article post. I wanted to write a little comment to support

you.

# March 8, 2013 6:11 AM
Leave a Comment

(required) 

(required) 

(optional)

(required)