Add to Technorati Favorites
Showing posts with label tutorial. Show all posts
Showing posts with label tutorial. Show all posts

Sunday, 12 August 2007

Making a 3 Column Blog

Blogger is great, we all know that - you can have a blog set up and running within about 2 minutes, and it'll look great just using the templates that they provide you with. If you're happy with the way things look then everyone will live in peace and harmony for ever and ever and ever. However, if there's something you want to change about the template, blogger can be a complete nightmare. Yes, everything is styled in CSS, which makes things a little bit easier, but if you don't know what's going on, you don't have a hope in hell of getting things to look the way that you want.

A couple of people this week have asked me how to make their default 2-column blogger template into a wider 3-column template - sounds pretty easy, but we are gonna have to get our hands dirty with the actual coding of the page to make it happen. Before we begin, a quick note: The blogger templates are set up so that they will be viewable on the smallest possible screen size (640x480) and people will not have to scroll horizontally. By increasing your width with 3 columns, the people using this resolution will have to do a lot of scrolling to see your content. However, looking at my stats for the last month for my blog, not one person was using this screen resolution (out of over 5,000 visitors), so this is a pretty moot point.

First of all, a bit of explanation on how the default blogger templates are set up. In order to get everything laid out on the page where they want it, they use Divs, and style them using CSS. Divs are a way in HTML of positioning a block of content exactly where you want it on the page. They're a little like tables, but instead of having to make sure that one table cell takes up x amount of space in order for another to appear in your desired position, with Divs, you can tell it an exact coordinate. Here's a diagram showing the Divs (and their names) on a default blogger template:


These are pretty self explanatory - the only one that may cause a bit of confusion is the outer-wrapper - this is basically a hold-all for all the other information contained within the page, and gives the divs contained within a reference for positioning. The divs will have different dimensions, depending on what default template you've chosen. This is how we want the template to look:

Here is where things start to get messy. The first thing we need to do is increase the width of the content-wrapper so that it can accommodate another sidebar on the left. The default sidebar is generally around 220 pixels wide, so we'll need to increase by this amount. Go into the Edit Template HTML page for your blog (dashboard>layout, then choose the Edit Template HTML tab at the top of the page). Now you need to find the part in the code that controls this outer-wrapper width - in the minima template this is about 1/3 of the way down the page - you're looking for:

#outer-wrapper {
width: 660px;
margin:0 auto;
padding:10px;
text-align:left;
font: $bodyfont;
}

This controls all the dimensions, margins and positioning for all your content in your blog. Some of the settings may be a little different, depending on your template, so don't be alarmed if this is the case. Change the width value to 780px. This is the maximum size width that people looking at your blog will be able to see without scrolling horizontally at 800x600 resolution (you need to allow 20px for the scrollbar on the right). While you're here, below the code you just edited, you'll see a section named #main-wrapper - change the float option in this section to center instead of left, so that it looks like this:

#main-wrapper {
width: 410px;
float: center;
word-wrap: break-word; /* fix for long text breaking sidebar float in IE */
overflow: hidden; /* fix for long non-text content breaking IE sidebar float */
}

This won't change much when people actually look at your page, but it will help you see things the way they're supposed to be in the layout editor. Now we need to change all the other divs so that they will fit with this new width. We'll deal with the header first, and work down. The header code is actually above the outer-wrapper code. This is what you're looking for:

#header-wrapper {
width:660px;
margin:0 auto 10px;
border:1px solid $bordercolor;
}


Again, change the width to 780px (we want the header to take up the entire width of the page). Same with the footer (further down the code):

#footer {
width:660px;
clear:both;
margin:0 auto;
padding-top:15px;
line-height: 1.6em;
text-transform:uppercase;
letter-spacing:.1em;
text-align: center;
}


Change the width to 780px again. Here's where things start to get interesting. The existing sidebar and the div that will contain the main content, we want to keep around the same size, and just budge them over enough to fit in another sidebar div. We need to copy and paste the existing sidebar-wrapper code to make the new sidebar to the left. Find this near the top of your code:

#sidebar-wrapper {
width: 220px;
float: right;
word-wrap: break-word; /* fix for long text breaking sidebar float in IE */
overflow: hidden; /* fix for long non-text content breaking IE sidebar float */
}


Change the width of this sidebar to 200px, then paste your new sidebar code directly underneath this one (it doesn't really matter where you put it, but it helps to keep all the wrappers together so you can find them easily if you need to. Change the values to something like this:

#sidebar-wrapper2 {
width: 170px;
float: left;
word-wrap: break-word; /* fix for long text breaking sidebar float in IE */
overflow: hidden; /* fix for long non-text content breaking IE sidebar float */
}


The float value just tells the div which side of the outer-wrapper to go to, you'll see on the other sidebar that this was set to go to the right. Now that we've set the style for our div, we need to actually create the div itself, so we have to move out of the CSS code block, and down to the HTML block, further down the page. Look for a block starting with this code:

<div id='sidebar-wrapper'>

Above this, paste the code for the new left sidebar:

<div id="sidebar-wrapper2">
<b:section class="sidebarLeft" id="sidebarLeft" preferred="yes">
<b:widget id="Profile1" locked="false" title="About Me" type="Profile">
</b:widget>
</b:section></div>

I've just added the "about me" widget to the left sidebar to give you something to fill the space in the layout editor, for when you come to add other widgets to this area, otherwise you'll have nowhere to drag your widgets to to add them to your new sidebar. You can remove this "about me" widget as soon as you've added another widget to the sidebar. Because you now have 2 "about me" sections, you'll need to delete the one for the right-hand sidebar, otherwise blogger will throw a tiz. Just delete this code

<b:widget id="Profile1" locked="false" title="About Me" type="Profile">
</b:widget>

from the right-hand sidebar div, which should now be just under the code you've just inserted.

All that remains is to copy the styles used for the right-hand side bar to the left one, so that they have a uniform style. Go back to the block of CSS code, and somewhere near the bottom you'll see a section specifically for the sidebar, starting with

/* Sidebar Content
----------------------------------------------- */


Here, you should see 4 or more styles relating to the right-hand sidebar, you need to copy these styles to the new left-hand sidebar by just adding the name of the sidebar to the list these styles apply to. So where you see

.sidebar {

replace it with

.sidebar, .sidebarLeft {

and where a certain element of the sidebar is changed, add the same element to the list for the left sidebar, so you might see

.sidebar ul {

change this to

.sidebar ul, .sidebarLeft ul{

likewise

.sidebar .widget, .main .widget {

becomes

.sidebar .widget, .main .widget, .sidebarLeft .widget {

and so on. Once you've copied all the styles for the right-hand side bar to the left-hand one, you should be pretty much done. You might want to fiddle around with the widths of the elements to make them fit better with your design, but apart from that most things should be fine. I would strongly suggest looking for a tutorial on CSS on the internet so that you understand fully what the code in your template is doing, and so you can edit it to look exactly the way you want it to without fear of breaking the template.

I hope you find this tutorial useful, and leave a comment if you have any problems with this or have a tip regarding this code, we're all here to help each other learn!

Friday, 27 July 2007

Podcasting: Beyond the Basics Pt. II - Use HTML in your description.

I know a few people have been waiting for this one, so hopefully Steve will leave me alone after this ;) Anyway, so far I've described to your the bare minimum you have to do in order to set up an XML file for podcasting. Now I'm going to show you how to set your podcast apart from the rest by using HTML in your XML file, so it looks much prettier and is more usable in podcatchers that can understand it, like Google Reader. I'm going to assume you have at least a bare-bones understanding of what HTML is, and how to program a simple web-page using it. If not, there's a half-decent tutorial here, or search for HTML Tutorial on Google.

So why should we do this? Well, ultimately, it's up to you, of course, but putting HTML in your XML file will benefit your subscribers in a few ways:
  • Most importantly, it will allow you to use line-breaks and paragraph breaks in HTML podcatchers. Without using this, your description will just be one large block of text. You can hit the enter key till you're blue in the face, and it might format correctly in iTunes, but nothing will change the way it looks in Google Reader.
  • Instead of offering web addresses to relevant websites for that episode, you can offer them as proper hyperlinks. Your subscribers will thank you for this alone.
  • Use pretty much anything you can do in HTML - tables, lists, images, backgrounds - make your XML mirror the style and layout of your website. About the only thing you can't do is to use JavaScript.
The only downsides are that it will take a bit more effort on your part to make sure everything works as it should, and that it will pretty much double the file size of your XML file. If you don't have many episodes in your podcast though, it's definitely worth doing.

Unfortunately, not all podcatchers understand HTML (including, unfortunately, iTunes - which is weird, as it uses HTML for the iTunes store. Bummer), which means we need to code our XML in such a way that people not using a HTML compatible podcatcher won't notice any difference to any other podcast out there. This took me a good few days of experimentation to work out an acceptable way of coding the XML to work in this way, and I've not seen any other podcast pull this off yet, so you're getting let in on an exclusive here.

First of all, you'll need to change the namespace tag at the top of your XML file. We're going to make it so it downloads definitions for not only the iTunes tags, but also for the HTML enclosure we'll be using. Right now, you're probably using this namespace tag:

<rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">

We're going to replace it with this one:

<rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:content="http://purl.org/rss/1.0/modules/content/" version="2.0">

If you don't understand what we just did - imagine until this point, we've been writing our XML file in French. Which is fine, because we told the computer where to find a French dictionary so it could understand what we wanted to do. Now we want to write part of the XML in German as well, so we need to tell it where to find a German dictionary also.

Now for each episode of the podcast, we're going to need 2 <description> tags: one containing just plain text, for iTunes compatible podcatchers, and the other containing HTML for the more advanced podcatchers. The reason we can't have everything in one <description> block: plain text podcatchers will just show the raw HTML code to your users, which just looks ugly. Here's what the code is going to look like for the description for one of the episodes:

<description>This week, Jim McJim explores the climes of Glasgow through the ages, from the abhorrent weather in the dark ages, through to today's less tolerable rainstorm.

You can get further information on Jim's travels at http://www.jim-mcjim.com/ or email him at jim@jim-mcjim.com</description>
<content:encoded><![CDATA[
<p><img src="http://farm1.static.flickr.com/29/38329648_f43ddc78e2_m.jpg" align="left">This week, Jim McJim explores the climes of Glasgow through the ages, from the abhorrent weather in the dark ages, through to today's less tolerable rainstorm.</p>

<p>You can get further information on Jim's travels at the <a href="http://www.jim-mcjim.com/">Jim McJim website</a> or email him at <a href="mailto:jim@jim-mcjim.com">jim@jim-mcjim.com</a></p>
]]></content:encoded>


You'll see that the two description blocks are essentially the same (you'd be a fool not to copy and paste ;) but the second one is instantly more accessible to your users - it includes a small thumbnail which sets the scene for the content of the podcast, and also the links to the website and email will actually go to those places when the user clicks them. Make sure you keep these surrounding tags exactly as you see them here:

<content:encoded><![CDATA[
HTML description goes here
]]></content:encoded>


The extra ![CDATA[ bit just makes sure that iTunes will not try and display this information.

And that's pretty much it! As I said before, you can pretty much use any of the tags you'd use to build a webpage, giving you an infinite number of possibilities for presenting your information to people subscribing to your podcast. If you put this to good use in your own podcast, drop me an email and maybe I'll feature it on the site! Don't forget to put a little link here if you get this up and running!

Friday, 29 June 2007

Podcasting: Beyond the Basics Pt. I - Autolink from your Website

Well, we should have a working podcast by now, and perhaps you've even got it listed in the iTunes directory, along with a couple of others. From now on I'm going to show you my own little experimentations with podcasting - stuff that I've learnt just by having an idea and working out how to do it myself, rather than it being widely known about, or available in any other podcasting guides.

The first thing I'm going to show you is how to turn on Autodiscovery of your Podcast from your website. It may sound complicated and technical, but all it does is put the little orange button in the address line of your browser so that people know there is a podcast or XML feed available to subscribe to along with the page. Clicking this symbol takes a reader straight to a page where they can preview the XML and subscribe to it if they wish.

To implement this on your website is pretty simple, and only requires one line of code to be added to your HTML. Put this in the <head> section of your web page code:

<link rel="alternate" type="application/rss+xml" title="Jim's Scottish Podcast" href="http://www.jim-mcjim.com/podcast.xml" />

And that's it! Change the blue sections for the title of your podcast, and the URL of the XML file, and you're good to go! This is a simple trick that's often overlooked, but really improves the usability experience.

Thursday, 28 June 2007

Step by Step: Making a Podcast, Pt. IV.

At this point in the tutorial, we're pretty much on the home stretch: you've made an episode, and uploaded it to the web. You've also made an XML file, which describes your podcast and links to this mp3 file. Theoretically, we should be at the point where we can start threatening iTunes that you have a new podcast to unleash on the world. However, first we need to make sure that there's no mistakes in your XML file which would cause podasting software to fall over and die.

This is where the similarity between HTML and XML ends. If a mistake is made in a HTML web page, the web browser might display the information a little iffy, but it will probably still display it. If you make a mistake in an XML file, the software will just stop reading your file, and nobody will be able to get your podcast. XML is very unforgiving in this sense, which is why it's important to make sure that your code has no mistakes before you submit it to any podcast directories or iTunes.

So what can go wrong with an XML file? Well, most mistakes will boil down to:
  • Typing error - even one letter out of place can stop your file working if it's in an XML tag.
  • Forgetting to close a tag - this will make anything trying to read your XML file get it's knickers in a twist.
  • Not escaping a character. This is something I'm always doing, and it makes iTunes instantly fall over. I'll explain this properly in a minute.
Just in case you're thinking "Well, I copied and pasted the code exactly, there's no way I could have made any mistakes!" - mistakes have a habit of creeping into XML files without you even noticing, and even if you've not made a mistake this time, there will come a time in the future when you do, so this is good to know about. If you're using something like Dreamweaver, there's much less chance of you making mistakes, as it highlights all the XML tags for you, and this makes things a little easier.

Before you give up on podcasting, thinking that you have to go through your XML with a fine-toothed comb in order to be able to find where the mistakes are, don't worry, help is at hand. Because you've already uploaded your XML to the web, you can now run it through a feed validator. This is a web program which will pick apart your code, and tell you about any errors it finds. You fix them, re-upload the file, and then try again. When you eventually get to the point when you have no errors in your code, you've achieved the amazing, and you're ready to test your podcast in iTunes, and then submit it to the directory.

Head over to the Feed Validator here. You'll notice it looks a lot like Google. All you do is type (or copy and paste) the URL of your XML file into the box and press the Validate button. You'll see a list of errors in your XML (and in most cases, an explanation on how to fix them), then a copy of your code, showing you exactly where the errors are. If you've just copied and pasted the code I gave yesterday, you'll probably have 2 errors which are non-critical (ie. they won't stop your XML from being read, but it's advising that you should do something about it):
  • item should contain a guid element
    iTunes likes to have a Globally Unique Identifier, to differentiate every single episode of every podcast - however, if this tag is not included, iTunes will just create it's own guid from the mp3 filename associated with the episode.
  • Missing recommended iTunes channel element: itunes:explicit
    This is another tag you can add to each episode (or under the <channel> tag, meaning that all episodes will have strong language) to tell iTunes that the recording contains explicit language. This is what it looks like:
    <itunes:explicit>yes</itunes:explicit> - use if your episode does contain strong language
    <itunes:explicit>no</itunes:explicit>
    - use if your episode does not contain strong language
    <itunes:explicit>clean</itunes:explicit>
    - use if your episode contains no strong language or anything that might be considered offensive in any way.
Something else that is very important to watch out for when coding your XML is making sure that you have escaped your characters. This is nothing to do with writing a novel about Colditz or anything even that exciting, unfortunately. Basically, in XML there are certain symbols which have special meanings, and if you want them to show up the way you intended, you have to substitute them with little codes. You've seen this already, without realizing it, probably - take a look at this snippet from yesterday's code:

<itunes:category text="Places &amp; Travel"></itunes:category>

The category shows up in iTunes as "Places & Travel", yet in your code, it's "Places &amp;amp;amp;amp;amp;amp; Travel". This is because the ampersand symbol has a special meaning for programs trying to interpret XML, so by substituting the &amp; code, you're telling it that you actually want the ampersand to show up in the text, and not to interpret it as a piece of programming. Here is a list of symbols that need to have these escape codes in place of them:
Character name xml
& ampersand &amp;amp;amp;amp;amp;amp;
< less-than sign &lt;
> greater-than sign &gt;
’ apostrophe '
" quotation &quot;
Try to be aware of these characters when coding your XML, as even one without the correct code substituted instead will stop iTunes (and most other podcasting software) from being able to read your file. I usually find it helpful to do a find-and-replace on the & symbol before I publish a new episode of my podcast (Ctrl-H in notepad/found under the "edit" menu in most other editors).
Once you've validated your feed, and it's not throwing up any significant errors (remember you'll have to save your file in your editor, then upload it to the same place as before, then put it through the validator to check the new version), it's time to test it in iTunes to see if it works, before we submit your podcast to the directory.
  • Open iTunes
  • Click Advanced (on the menu bar) > "Subscribe to Podcast..."


  • Type the URL of your podcast, and click ok.
  • You'll be taken to the podcast area of iTunes, and iTunes will start trying to get your podcast. All being well, you should see a spinning orange icon next to your podcast title, indicating that it's currently being downloaded:

    If it's not worked, and iTunes has found an error in your XML, or can't find the URL you're pointing it to for the mp3 file, you'll get an exclamation mark next to your podcast:

    In this case, you need to go back to your XML code, find the problem (or problems), correct them, and try this process again. If your code has validated ok, then chances are you've either not escaped a symbol somewhere in your code, or you've put the wrong URL to your mp3 file in your code. Pay special attention to these things.
If you got the spinning orange icon first time, congratulations! You now have a working podcast! Next we'll look at submitting your podcast to the iTunes directory, so you can start getting some listeners!

Tuesday, 26 June 2007

Step by Step: Making a Podcast, Pt. III

Now that we've got an mp3 file stored somewhere on the net, we need to create our XML file, so that iTunes and other podcatching software knows where to find and download this mp3 from.

First, let's have a look at what an XML file actually looks like. Below is some typical XML podcast code:

<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">
<channel>
<title>Jim's Scottish Podcast</title>
<link>http://www.jim-mcjim.com
</link>
<language>en</language>
<copyright>Jim McJim, 2007</copyright>
<itunes:subtitle>A weekly changing podcast on the ever changing weather of Scotland</itunes:subtitle>
<itunes:author>Jim McJim</itunes:author>
<description>Have you ever wondered what the weather was like in Scotland last week? Wonder no more as Jim McJim takes you on a whistle stop tour of Scottish Weather through the ages.</description>
<itunes:image href="http://www.jim-mcjim.com/jimsporran.jpg"> </itunes:image>
<itunes:owner>
<itunes:name>Jim McJim</itunes:name>
<itunes:email
>imjim@jim-mcjim.com</itunes:email>
</itunes:owner>
<itunes:category text="Places &amp; Travel"></itunes:category>
<itunes:keywords>Scotland, Weather, Jim McJim, Rain</itunes:keywords>
<item>
<title>Aberdeen</title>
<itunes:author>Jim McJim</itunes:author>
<link>http://www.jim-mcjim.com/aberdeen26062007.mp3</link>
<itunes:subtitle>A quick look at Aberdeen's greyness through the ages.</itunes:subtitle>
<description>Don't be fooled by Global Warming and El Nino, Aberdeen has always had crummy weather, as we set out to prove in this weeks installment of Jim's Scottish Podcast. Jim is always taking suggestions for where to do his Scottish podcast on next, and he'll happily tell you exactly how rainy it's been just about anywhere in the country. Contact Jim on imjim@jim-mcjim.com.</description>
<enclosure url="http://www.jim-mcjim.com/aberdeen26062007.mp3" length="57099128" type="audio/mpeg"/>
<pubDate>Thu, 19 Apr 2007 11:14:18 GMT</pubDate>
<itunes:duration>59:12</itunes:duration>
<itunes:keywords>Scotland, Aberdeen, Rain</itunes:keywords>
</item>
</channel>
</rss>

At first it looks like a complete mess, but if you look closely, it actually makes a lot of sense - XML was designed so that computers could interpret it, but it was also designed so that the average human could look at it and see exactly what was going on as well. You could pretty much copy and paste that snippet into a blank notepad document, change it to the details you need, and use it as your XML if need be, without even reading the next part.

If you've programmed a web page using HTML before now, the XML will appear very familiar to you - the difference between them though is that whilst HTML describes everything that goes on in a page (including pictures, formatting, backgrounds, tables etc.), XML only describes the data, and leaves the formatting up to the page hosting the XML document, or the program or device it's being shown in. You'll notice, like HTML, that each snippet of data is held between two "tags", which describe what data is contained in that tag. There is always an opening tag: <data> , and a closing tag: </data>

Now we know the basics of an XML file, let's pick apart the above example, tag by tag, so that we can better understand what's going on with this file.

  • <?xml version="1.0" encoding="UTF-8"?>
    This tag must always be at the start of every podcast XML file - it basically just tells any program reading this file that it's an XML file. Never change this tag, as anything trying to "tune in" to your podcast will just get confused.
  • <rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">...</rss>
    This is what is known as the "namespace" tag. Every XML file must have one, and it tells any program reading the file what each tag means. For just a standard podcast, use this tag, as it includes all the information needed for the iTunes tags, as well as standard podcast tags.
  • <channel>...</channel>
    This is where the podcasting magic begins. This tag just tells us that everything between these tags will be a new podcast. You can put more than one channel into an XML file, but I wouldn't recommend it. You'll notice that just about everything else in the file is enclosed in these tags.
  • <title>Jim's Scottish Podcast</title>
    This is the title of the pocast, as it will show up in the podcasting software.
  • <link>http://www.jim-mcjim.com</link>
    This is just the website associated with the podcast. If there's the option to link to a website in the podcasting software, this is where it will take you.
  • <language>en</language>
    This is the default language for the podcast. In this case it tells us that it will be standard English. We could be more specific and set this instead to "en-gb", which software would interpret as British English. There is a list of different values for different languages here.
  • <copyright>Jim McJim, 2007</copyright>
    Pretty self-explanatory, who holds the copyright for this podcast. This might be a single person, as in this example, or it might be a company.
  • <itunes:subtitle>A weekly changing podcast on the ever changing weather of Scotland</itunes:subtitle>
    The iTunes subtitle: gives an annotated description of what the podcast is about in iTunes. There's a couple of other podcast directories that read this value as well. It's best to be as concise as possible when setting this, as it may be the deciding factor as to whether someone listens to your podcast, or passes it by.
  • <itunes:author>Jim McJim</itunes:author>
    Another iTunes specific tag - this is the Author or main producer of the podcast. This will usually be the same as the copyright holder.
  • <description>...</description>
    This is where you can be as descriptive as you want on what your podcast is about. iTunes shows this description on the individual podcast page, as do most podcasting websites.
  • <itunes:image href="http://www.jim-mcjim.com/jimsporran.jpg"> </itunes:image>
    This is the image that iTunes will show in the podcast charts, and on the individual page describing your podcast. This must be a JPEG, and it is most effective if it is square. Your podcast will get much more exposure if you have a decent image.
  • <itunes:owner>
    <itunes:name>Jim McJim</itunes:name>
    <itunes:email
    >imjim@jim-mcjim.com</itunes:email>
    </itunes:owner>
    More iTunes specific owner information. Again, this will usually be the same as the copyright holder's details.
  • <itunes:category text="Places &amp; Travel"></itunes:category>
    This is the category that your podcast will be placed under in the iTunes directory. Some other podcasting websites also use this. There's a full list of what you can set this value as here.
  • <itunes:keywords>Scotland, Weather, Jim McJim, Rain</itunes:keywords>
    Words that people might use to search for your podcast in iTunes. Try to think of as many words as possible, but keep within the realms of what your podcast is about. The more words you choose, the further down the "relevance" list your podcast will appear, so be as specific as possible. Seperate each term with a comma.
  • <item>...</item>
    This is the next tag you need to pay attention to. Everything between a set of <item> tags describes one episode of your podcast. You can many item tags in one XML file. You'll notice that a few of the tags contained within this one are the same as for the podcast itself - these fulfill the same function, but instead of describing the podcast now, they're describing an individual episode.
  • <link>http://www.jim-mcjim.com/aberdeen26062007.mp3</link>
    For each episode, include a link tag which is the URL of the mp3 file associated with this episode. This will allow people looking at the podcast on websites to go straight to the mp3 file, and stream or download it. It's less helpful for an episode link tag to go to the podcast website.
  • <enclosure url="http://www.jim-mcjim.com/aberdeen26062007.mp3" length="57099128" type="audio/mpeg"/>
    This is where the real magic happens - the tag which tells iTunes and other podcasting software where the episode mp3 file (or video file) is contained. Change the value in the quotes next to url to the URL where you stored the mp3 file. The length value is the size (in bytes) of the file (right click the file in windows explorer, and go to properties so get this value). Type is the type of file this is, in most cases this will be an mp3 file, but it could be a video file. The following table shows other file types values this might be:
    File Type
    .mp3 audio/mpeg
    .m4a audio/x-m4a
    .mp4 video/mp4
    .m4v video/x-m4v
    .mov video/quicktime
    .pdf application/pdf
  • <pubDate>Thu, 19 Apr 2007 11:14:18 GMT</pubDate>
    The date this episode was produced. It must be kept in this exact format, or your episodes will most likely end up in the wrong order.
  • <itunes:duration>59:12</itunes:duration>
    The duration of the episode, in hours:minutes:seconds. In this case the episode is 59 minutes and 12 seconds long. It's important to set this right, otherwise iTunes will list your episode as having no duration.
  • <itunes:keywords>Scotland, Aberdeen, Rain</itunes:keywords>
    Keywords applicable to the individual episode.
  • </item>
    </channel>
    </rss>
    These close the episode, channel, and XML file, respectively. Remember that after the closing item tag, and before the closing channel tag, you might have one or more item tags, each with their own title, description, enclosure etc. tags within them, and all describing seperate episodes.
This is pretty much a bare bones XML file, which as stated earlier, you could copy and paste into notepad, change the values so they are applicable to your podcast, save it as "podcast.xml" (or similar - just make sure that your filename ends ".xml" - in the "save as type" chooser in the "save as..." dialog box, you might want to change it to "*.*" instead of "*.txt", as this will ensure that notepad doesn't change the file extension), and upload to the web. This is the bare minimum of tags that are required to get your podcast into most podcasting directories, and iTunes, but there are other tags as well, these are listed in the Apple technical specifications here. Some of the iTunes tags just double up on tags that are already described here though, which is why I've chosen not to include them. iTunes is big enough and ugly enough to work out what should go where without you having to put the information in twice.

Next I'll take you through the process of validating your XML file to make sure it works in iTunes and other podcasting software, before we list it in the iTunes directory.

Step by Step: Making a Podcast, Pt. II

OK, yesterday we covered what a podcast actually is, and what it consists of. Today I'm going to give you some advice on sound files, then we'll cover the basics of creating your first XML file. Video podcasting is almost exactly the same, but I have no experience of it, so don't feel qualified to advise on the best filetypes for doing this. If you're video podcasting I'll give you some hints at what format to encode in later.

Creating your sound files:
I'm not going to go into the actual mechanics of creating your podcast programme itself, as I don't know what sound editor you've chosen to use (although there is some advice on how best to record DJ mixes in an earlier blog post). When you're recording, it's best to record a high-quality file, then we can make it lower quality (if need be) when we put it onto the 'net. It's not possible to make a high quality file out of a low quality recording, so at this stage in the process it's important to work at a fairly high recording quality. This will usually mean recording your podcasts in stereo, at 44.1Khz, 16bit. These are the settings you would choose in Adobe Audition to get this:

It's not totally necessary to know what these numbers mean, just that the higher these numbers, the more accurate the recording will be (the quality of the end recording obviously depends on other factors as well though, like the quality of the microphone and sound card you're using, as well as the amount of background noise whilst recording). The settings mentioned before are the same as CD quality sound, which is fine for this stage in the process.

Once you have your first programme recorded and ready to go, it's now time to compress it ready to put on the net. At the moment, you've probably got it saved as a Wav file (or maybe an Aiff file if you're using a Mac), but right now for every minute of audio, this file is taking up about 10 megabytes (Mb), so a 20 minute recording would weigh in at 200Mb. Obviously this is far too big for people to download, so we compress it to save them time, and you bandwidth charges. If we make this into an Mp3 file, we can keep roughly the same quality, but make the recording only take 1Mb for every minute of audio. This is clearly much better.

To produce my podcast, I encode my mp3 files at 128Kb/s, stereo, 44.1Khz, but you may want to use a lower/higher bitrate depending on how necessary it is to retain the original quality of the recording. I chose these settings, because for music, it still gives a fairly decent sound quality - if I were to choose a bitrate of 256Kb/s, the recording would not really be noticeably better, and would take twice as much bandwidth and twice as long for everybody to download. These are things that you need to be very aware of when creating these files. If you're using Adobe Audition to create your recordings, just go to file>save as... type a file name, then under "save as type" choose "mp3PRO (FhG) (*.mp3)".

Click the options button at the bottom of the window, and choose the "128Kbps Stereo (Internet)" preset from the list. If you want to make your final files higher or lower quality than this, now is the time to change these settings.

Now you have a file that people can listen to, but there's still a couple of things we need to do before we put it onto the internet...

Adding extra information to your sound files:
All we have so far is an mp3 file, with some audio in it, but mp3 files can also store a lot more information than just the audio in them - they also contain the name of the track, the artist and copyright information, and often some album artwork as well. It's usually a good idea to make sure that each of your podcast episodes contains this information in case it gets separated from the rest of the podcast for any reason, and also this is the information that will show up when it's played on an iPod or other portable mp3 player.

iTunes is fine for adding this information to your tracks, and the process is the same on both Macs and PCs, so I'll use this.
  1. Open iTunes up, then go to file>add file to library...
  2. Choose the mp3 file you saved, and click "open".
  3. You should now see the file you created in your iTunes library. (You may need to click "music on the left hand side of the iTunes window to bring up your library. If you can't find your file in the list, search for the filename using the search box in the top right hand corner of the window)
  4. Right-click on your file, and choose "Get Info" from the top of the menu. This will bring up all the information that this mp3 file contains in a summary.
  5. Click the "Info" tab at the top of this window, and you will be able to fill in the artist and title information. Make sure you put your email address in the comments field so that people know how to get in touch with you if they have comments on your podcast. Also be sure to choose a suitable genre for your podcast, if the genres already in iTunes don't fit the bill, don't be afraid of typing your own into this box. It's far better to have a fitting custom genre, than to label it "Pop" because it's the nearest fitting thing. Put the name of your podcast in the "Album" field.
  6. When you're done, click the "Artwork" tab at the top of the window, and click the "Add..." button. Choose a suitable picture to grace your recording with. This is the picture that will show up in iTunes whenever somebody plays your podcast, and on newer iPods. It's usually best to give each episode the same picture for consistency, and I'd recommend setting this as your podcast logo (if you don't already have one, I suggest you make one now - you'll need this to list your podcast in the iTunes directory). It looks best if this image is a square Jpeg file, but iTunes can cope with a rectangular one. My logos are 512x512 pixels in size.
  7. Click the OK button at the bottom of this window. iTunes will now save all the information you've just entered to the mp3 file. If it's a long recording, this can take a little while, so be patient.
Now your mp3 file is ready to upload! Upload it to anywhere on the web that will give you the space and bandwidth to put your files, next I'll show you how to make your XML file.

Monday, 25 June 2007

Step by Step: Making a Podcast, Pt. I



Ok, there seems to be a lot of information out there on the internet on making podcasts, but nothing that really makes a lot of sense - I basically had to cobble together information from a lot of different sources in order to get mine up and running, so I thought I'd make a guide on how to produce your own podcast from start to finish, including the all-important getting it in iTunes steps. I'll also show you how to make your accompanying textual information for each episode to look nice in not just iTunes, but HTML readers like Google Reader as well, which is becoming just as important as iTunes.

First I'll explain a little about what a podcast actually is, for people that don't know - a podcast is basically like an internet newsletter - every time a new issue is produced, your computer automatically downloads the latest one. The difference between a podcast and a newsletter though is that a podcast can contain audio and video, meaning that you can set your computer up to automatically put the newly downloaded episode onto your mp3 player (no, it doesn't have to be an iPod, although Apple have made all this very easy with their iTunes software). There are podcasts on virtually anything, from just simple audio/video blogs to your favorite bands and language courses, and the best thing is that most of them are free! The beauty over traditional streaming internet media is that once you've subscribed to a podcast you like, you don't really have to do anything else to get any new episodes as they're produced, they come to you!

What you will need to make your first podcast:
  • A text editor. Notepad will do, but if you want to use something more suited to web programming like Adobe Dreamweaver, it's up to you. I wouldn't recommend Microsoft Frontpage, as it seems to get in the way more than it helps you to do this.
  • A sound/video editor for creating the episodes. Personally I use Adobe Audition 1.5, version 2 is out now, but for what I do, a lot of the features aren't necessary. If you got Nero with your CD Burner or your computer, there's a sound editor built into it. You'll probably also need a microphone, or some other way of getting sound into your computer.
  • Some space on the internet somewhere. If you don't already have some, go to Googlepages for 100Mb free.
  • iTunes is helpful, but not essential (most people who listen to podcasts do so through iTunes, so making your podcast iTunes compatible will increase your listenership by a huge amount). iTunes is also free, and is useful for adding album artwork to your episodes.
Before we start on what goes on behind the scenes in a podcast, you need to think about what you're going to put on your podcast. Remember there are so many podcasts out there already, how are you going to set your's apart from any other that's out there? This is something that you should really try and work out before you start producing anything, if you have a clear creative focus, people will know what to expect from your podcast, and are more likely to subscribe to it.

Now a bit of information about what actually makes the magic of a podcast happen. A podcast consists of one XML file, and many sound/video files. You're probably already familiar with sound and video files on your computer, so I'll save you an explanation of that. An XML file is basically a contents file: it just tells the computers subscribed to the podcast the location of each sound/video file, plus a description of the content of the files. It's this file which we'll be concentrating mostly in this tutorial. You'll have come across XML files more than you think as you browse around the internet - any time you see this symbol in your web browser (at the end of the page address if you have Firefox, or usually on the button bar if you have Internet Explorer 7 (Microsoft have only just cottoned on to the fact that this is actually usful). If you click this icon in Firefox, you'll see a lot of the information that makes up the page, but without any of the formatting. You'll also be able to tell Firefox to subscribe to this information in Google Reader, meaning that every time the information is updated, it will get listed in your Google Reader, and you'll be able to get all your interesting stuff in one place, instead of having to go to 100 different websites for it. The XML file basically contains just the information on the site, without any formatting information, which means that the same file can be used in Google Reader, or your E-mail program, or your mobile phone. It's up to the software itself to decide how best to display this information. Even this blog has an XML file, automatically produced every time I write a new entry. If you were to subscribe to it in Google Reader, this is how it would appear:

All the information is the same, but it's presented in a much more structured and information-centric way (much like usenet groups used to be presented in days of yore, but with websites, instead of discussions), along with any other subscriptions listed to the left of the page, and without any of the website branding and images getting in the way.

Tomorrow I'll show you what a raw XML file looks like to us mere mortals, and how to create a podcast using this magical technology, for now, try going to a few of your favorite websites, and try subscribing to their feed by clicking the orange icon (if they have one), you never know, if you have a blog on the internet, you may have already created your own feed without realizing it!

On to Part 2...