Making iTunes Subscription Easy

I’ve got two podcasts, one for model photography and the other for EMTs. They are both in iTunes, but it can be something of a pain to find them. Sure a user can search for them by name and they show up, but you’d really like them to be able to just type something into a browser and be taken straight to the iTunes subscribe page.

Plus in a podcast you need to say the URL and iTunes URLs are complicated. Too complicated to say and expect people to type it. Plus they often aren’t in front of a computer when they listen, so they need to be able to remember the URL to subscribe.

So what I do is tell them to “Enter www.emsnewbie.com/iTunes into any browser”. Which is easy to remember, easy to type, and gives me the power to change things in the future if I have to.

To do this I use an Redirect command in a .htaccess file. Most Unix based webservers allow these files and you can do a lot with one. But we’ll focus on just doing the iTunes redirect.

At the root of the directory on your web server you need to have a file named .htaccess. It may already exsist, especially if you are using blogging software like WordPress.

Since the file name begins with a period, it is normally invisible in Unix and may not be displayed in your FTP client. Tell your client to show invisible files to look for it.

Once you find the file, open it. Or create a new empty text file and name it .htaccess.

You will need to enter the following in the file.


<IfModule mod_rewrite.c>
RewriteEngine On
Redirect 301 /itunes http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewPodcast?id=318136316
Redirect 301 /iTunes http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewPodcast?id=318136316
</IfModule>

The key lines are the Redirect 301 lines. These tell the server to tell the browser to go somewhere else when a URL ending with iTunes comes in. Also notice that I have two lines because I found ModRewrite was case sensitive. There may be a way to do it so it isn’t but I don’t know it, so I just made two lines. Sometimes people remember the capital T and sometimes they don’t.

Remember I said the file may already exists because you are using WordPress? Well just follow the directions in the .htaccess WP created and don’t put your lines in the middle of theirs.

Should iTunes change the way they do their links in the future, I can change the URL here and nothing has to change anywhere else. Heck I use the /iTunes URL for links on the page, like the Subscribe in iTunes buttons.

This makes it much easier to tell people where to go to subscribe with iTunes. You could adapt this to a lot of different uses, but this will get you started.

Custom RSS Feed for a Podcast Category

I’ve started a podcast for my GlamourApprentice.com site. To make things easier I just made the podcasts their own category in WordPress and created a feed burner feed for that categories RSS2 feed.

The first episode went out and I subscribed to it in iTunes by entering the Feedburner RSS feed. And the name for the podcast was wrong. It was “Glamour Apprentice >> podcast.

The reason for this is the RSS2 template in WordPress uses the blog’s title, desciption and URL for the header information in all of its RSS feeds. I’m not positive this is the way to handle it if the feed is a category feed, but that’s the way it is.

Looking for a Solution.

I went looking for away to change this information for my category feed. I found this article on how to change the RSS title returned by hacking the feeds.php file in your WordPress installation.

That would work, but you have to remember to save your feeds.php files every upgrade. And since that can happen automatically, that’s a pain. You just shouldn’t change any file outside of the wp-content directory in WordPress.

The Solution

Now that I know where to look, I realized there were hooks to change these same routines without editing them directly. I’d hoped maybe I could just change things in my theme, but that didn’t seem to be possible. Plus the right solution would be theme independent.

The solution is to write a very simple Plugin. Which is what I did. Here’s the source:


< ?php
/**
 * @package Podcast Category RSS Name Changer
 * @author Ron Davis
 * @version 0.1
 */
/*
Plugin Name: Podcast Category RSS Name Changer
Plugin URI: http://www.glamourapprentice.com/
Description: Hack to change the name of my podcast category RSS to the name of the podcast
Author: Ron Davis
Version: 0.1
Author URI: http://www.glamourapprentice.com/
*/

function changeCat() {
     if (in_category('28')) { 
        echo 'The Shooting Beauty Model Photography Podcast'; 
     } else
     { 
     	echo get_wp_title_rss(); 
     } 
}

function changebloginfo_rss($result='', $show='') {
     if ( in_category('28') )
     {
 		switch ($show) {
			case 'name':
				$result = ''; 
				break;
			case 'url':
				$result = 'http://www.glamourapprentice.com/podcast';
				break;
			case 'description':
				$result = 'Engaging interviews with photographer and models discussion the art and collaboration.';
				break;
			default: 
        }
        return $result;
     } else
     { 
     	$result =  bloginfo_rss($show); 
     }
	return $result;
}

add_filter('wp_title_rss', 'changeCat', 1);
add_filter('bloginfo_rss', changebloginfo_rss, 1, 2);

?>

 

Warning: it is just a hack. It is very specific to my blog, and if you use it you are doing so at your own risk.

What I wanted to do was get rid of completely the blog title, and then instead of the category name, use the podcast’s title. While investigating I discovered it was using the blog’s description and URL, which I also wanted to change.

You need to know the category number. You can find this in your WP Dashboard under Posts->Categories. You enter that in the lines 17 and 26. My podcast’s category was 28. You could use the name of the category, but you might change that later and it would break the plugin.

On line 18, you enter the title of the podcast. This will replace the BlogName >> CategoryName default.

Then you would replace the information name, url, and description with your values.

Upload the text file with a name like “podcatchanger.php” into your plugins directory on your site, then activate the plugin in your Dashboard.

That should be it. Your RSS feed should have the correct information in it now.

This could be made more generic, maybe given an interface, but I don’t have time for that.

TD Word Count Plugin

Wanted to get the word count back on my blog posts, so I went looking for word count plugins. I found to that I downloaded and installed. One does what I wanted, which was word count on a post bases.

The other was TD Word Count. It counts your total words, average per post and gives you your longest posts. That’s fascinating information. Here’s my top 10 longest posts.

+ 291,535 total published words from 1,667 posts
+ 754 total unpublished words from 6 posts
——————————————————–
= 292,289 total all words from 1,673 posts
= 174 average words per post
281 (16.7962%) posts contain 300+ words

1 My church history: The Married Years 2,028 w 2004-10-27 09:58:30

2 5 Things Christians Do That REALLY Annoy Me 1,932 w 2006-11-27 14:17:44

3 Moral and Ethical Decisions on the Use of Deadly Force 1,873 w 2007-02-15 13:33:38

4 What Happens After the Gun Fight 1,792 w 2007-02-20 15:04:44

5 Pussification 1,709 w 2003-11-05 13:56:14

6 How To Shoot Well 1,297 w 2007-02-13 11:41:27

7 A Following 1,266 w 2008-02-15 10:45:41

8 Audio Interview with Adam Curry 1,262 w 2003-10-07 16:53:11

9 NYC Injustice 1,185 w 2004-05-26 11:21:59

10 RX-8 1,133 w 2004-07-12 11:49:47

WordPress 2.0

So I upgraded the Mrs yesterday and myself today. Admin interface is much nicer. If this posts, then XML-RPC works.

My theme works, but I’m going to be changing it so it will work with widgets.

One weird and a little annoying is you have to sign up for a WordPress.com account – which creates a blog for you – just to use the new built in comment spam filtering. But for you the reader I did it and the image thing is gone from comments.

Updates to come.

Email Comment Subscription

I realized today that when I comment on someone’s comment they probably don’t notice. (I commented on your comment Shelli). So I decided I’d look for a way for people to be notified when there was a comment on something they commented on.

Enter the WordPress plugin Subscribe to Comment. Now installed and you can click a check box when you comment and you will be emailed whenever a new comment is posted to that thread.

Hope that helps.

Technorati Tags: ,

SA-Autolink WordPress Plugin

I installed a WordPress plug in called SA-Autolink that automatically links words. You enter a word and a URL and everywhere that word is used, it will be turned into a hyperlink to the URL you provide.

I did this for words like WordPress and Dreamhost. Only problem is it does links inside of links. So the Techoncrati tags get double linked. The words use in titles gets double linked.

I need to go through and the code and see about making it not do things already inside a link. But not today.

Technorati Tags: ,

More Site Optimization From Yuma

Yuna did it again with another great article on making your blog more search engine friendly. The big change caused this time is Reactuate’s URLs are now different. Go on click on an article title and look at the URL. It’s all text baby.

WordPress rocks!

I need to do something about keywords. I’d like the categories for an individual message to be used as the keywords on individual message pages, but I’ll have to look into how to do that with WordPress.

UPDATE: I added keywords and other meta tags to the site. They are the same for every page, and there are probably too many of them, but we’ll see. I actually looked at the source of Christine/Yuna’s page to get what tags I should add.

Also added Yuna to my feed reader and the next time I update the blog roll she’ll be listed.

Technorati Tags: , ,

Another WordPress Theme Site

I’d posted about a theme site for WordPress in the past, but it was only those themes in a theme contest when 1.5 first came out. There is a new site that has all those WordPress themes and more.

The only thing I don’t like about this theme site is it doesn’t have the next or the download links like the contest one.

I’m looking for a new theme for a site I’m getting ready to start. I’d like a three column theme. And/or one that uses a golden ratio.