WordPress.org

Forums

podPress
Podpress and Podtrac together (13 posts)

  1. drezac
    Member
    Posted 3 years ago #

    Quick question-

    We use Podpress on EdReach.us- I'm trying to implement the Podtrac player because my site has multiple category feeds. The Podtrac player asks that for the iTunes subscription for each podcast, you must:

    To enable subscriptions coming from Podtrac Player to increment iTunes subscription counts, Podtrac recommends publishers include the iTunes Podcast ID in RSS feeds by adding the following tag using the format below:
    channel <podtrac:itunespodcastid>123456789</podtrac: itunespodcastid>
    where "123456789" is the Podcast ID assigned by iTunes

    How can I add an iTunes tag to my RSS feeds within podpress for each individual category feed? Wouldn't it be nice if there was a blank field in the iTunes setup page where one could add their own tags like this?

    Let me know if you can help. I'm really looking for a nice way to show off all these shows in one complete package.

    Daniel
    EdReach.us

  2. ntm
    Member
    Plugin Author

    Posted 3 years ago #

    How can I add an iTunes tag to my RSS feeds within podpress for each individual category feed?

    There is possibility to add such a tags with podPress.

    Currently I have not enough time implement such an options.

    But if you are not afraid of editing e.g. the functions.php of your theme then you may add something like this:

    /* This function adds the podtrac namespace in all RSS2 feeds of a blog. */
    add_action('rss2_ns', 'podtrac_rss2_ns');
    function podtrac_rss2_ns() {
    	echo 'xmlns:podtrac="http://www.podtrac.com/player2.0/tips.php#rss"'."\n";
    }
    
    /* This function adds podtrac RSS tags to certain category feeds (RSS2 feeds). */
    add_action('rss2_head', 'podtrac_rss2_head');
    function podtrac_rss2_head() {
    	Global $wp_query;
    	if ( is_category() ) {
    		$cat_id='';
    		// If it is a category feed then try to retrieve the ID or the slug name of the category.
    		if ( FALSE === empty($wp_query->query_vars['cat']) OR FALSE === empty($wp_query->query_vars['tag']) OR FALSE === empty($wp_query->query_vars['category_name']) ) {
    			if ( FALSE === empty($wp_query->query_vars['category_name']) ) {
    				$cat_id = $wp_query->query_vars['category_name'];
    			} elseif ( FALSE === empty($wp_query->query_vars['tag']) ) {
    				$cat_id = $wp_query->query_vars['tag'];
    			} elseif ( FALSE === empty($wp_query->query_vars['cat']) ) {
    				$cat_id = $wp_query->query_vars['cat'];
    			}
    		}
    		// If it is a category feed and an ID or the slug name exists, add the tags related to this category feed.
    		Switch ($cat_id) {
    			case 'mobile-learning' : // insert the name or the ID of the category here
    				echo "\t".'<podtrac:itunespodcastid>987654321</podtrac:itunespodcastid>'."\n";
    			break;
    			case 'mp3' :
    				echo "\t".'<podtrac:itunespodcastid>123456789</podtrac:itunespodcastid>'."\n";
    			break;
    			// ......
    		}
    	}
    }

    This is probably not as comfortable as a form on a settings page but you can edit this file via the Admin site (Appearance > Editor > Theme Functions (functions.php)) of your blog.
    Insert e.g. instead of mp3 or mobile-learning the names or IDs of the categories you want to. Maybe copy and paste the 3 lines

    case '...' :
    				echo "\t".'<podtrac:itunespodcastid>...</podtrac:itunespodcastid>'."\n";
    			break;

    You may also add different Podtrac RSS tags with this sheme:

    case '...' :
    				echo "\t".'<podtrac:itunespodcastid>...</podtrac:itunespodcastid>'."\n";
    				echo "\t".'<podtrac:...>...</podtrac:...>'."\n";
    			break;

    The more I think about the whole issue the more I ask myself why Podtrac does not write a nice little plugin which does something like that. They know there API and documentation better then anyone else. Furthermore is it not in their business interests to offer such a plugin to the large group of WP users?

    Anyway, If you have questions about the code snippet above then please ask.

    Tim

  3. drezac
    Member
    Posted 3 years ago #

    Not to mess around with the Podpress php, but couldn't we just add a field to the category page that adds the itunes Tag?

    I suppose that with any Podpress update this could get removed.

    Dan

  4. ntm
    Member
    Plugin Author

    Posted 3 years ago #

    Dan,

    the code above will survive any podPress if you put it into the functions.php file of your theme. But it would maybe not survive a theme update.

    So lets make a little plugin:

    <?php
    /*
    Plugin Name: Podtrac additional feed elements
    Plugin URI:
    Description: This plugin adds additional elements to the category RSS feeds of this blog.
    Author: ntm
    Version: 1.0
    Author URI:
    */
    
    /* This function adds the podtrac namespace in all RSS2 feeds of a blog. */
    add_action('rss2_ns', 'podtrac_rss2_ns');
    function podtrac_rss2_ns() {
    	echo 'xmlns:podtrac="http://www.podtrac.com/player2.0/tips.php#rss"'."\n";
    }
    
    /* This function adds podtrac RSS tags to certain category feeds (RSS2 feeds). */
    add_action('rss2_head', 'podtrac_rss2_head');
    function podtrac_rss2_head() {
    	Global $wp_query;
    	if ( is_category() ) {
    		$cat_id='';
    		// If it is a category feed then try to retrieve the ID or the slug name of the category.
    		if ( FALSE === empty($wp_query->query_vars['cat']) OR FALSE === empty($wp_query->query_vars['tag']) OR FALSE === empty($wp_query->query_vars['category_name']) ) {
    			if ( FALSE === empty($wp_query->query_vars['category_name']) ) {
    				$cat_id = $wp_query->query_vars['category_name'];
    			} elseif ( FALSE === empty($wp_query->query_vars['tag']) ) {
    				$cat_id = $wp_query->query_vars['tag'];
    			} elseif ( FALSE === empty($wp_query->query_vars['cat']) ) {
    				$cat_id = $wp_query->query_vars['cat'];
    			}
    		}
    		// If it is a category feed and an ID or the slug name exists, add the tags related to this category feed.
    		Switch ($cat_id) {
    			case 'mobile-learning' : // insert the name or the ID of the category here
    				echo "\t".'<podtrac:itunespodcastid>987654321</podtrac:itunespodcastid>'."\n";
    			break;
    			case 'mp3' :
    				echo "\t".'<podtrac:itunespodcastid>123456789</podtrac:itunespodcastid>'."\n";
    			break;
    			// ......
    		}
    	}
    }
    ?>

    Copy that code into a text file, name it e.g. podtrac_rss_tags.php and upload it into the plugins folder of your blog. Maybe create a new sub folder for that plugin (e.g. /wp-content/plugins/podtrac_rss_tags/). Afterwards the plugin should be visible in the list of plugins in your blog. You can activate and deactivate it easily and if you make delete or an important bracket or other code element while you are editing the slug names or something else then it may harm the blog or a RSS feed but you can always help yourself by renaming or removing this plugin file. WP will automatically deactivate this plugin if you do that and all will be fine again.

    Please try it. It is not that difficult and easy to fix if something should go wrong.

    couldn't we just add a field to the category page that adds the itunes Tag

    If I would do that then I would have edit not only one file and their is alot to consider when it comes to user interface elements. It would definitely take a lot of time to do this. Time that I don't want to spent on that issue.

    Furthermore these Podtrac RSS tags do not rely on podPress. They work with and without it. That is why I think that the best place for such a field to add the iTunes ID of a podcast and further Podtrac feed tag content is in a separate plugin. Such plugin would also work with other podcasting plugins.

  5. drezac
    Member
    Posted 3 years ago #

    Just FYI-

    Looking through the bottom of this awesome plugin you created- thanks. I have 7 individual category feeds with unique iTunes IDs as well. Am I supposed to add something on the bottom there, or was it good to go as is?

    Wow! Thanks.

    Dan

  6. ntm
    Member
    Plugin Author

    Posted 3 years ago #

    Am I supposed to add something on the bottom there, or was it good to go as is?

    Not exactly at the bottom.

    But among the last lines, you can find two section like this:

    case 'mobile-learning' :
    	echo "\t".'<podtrac:itunespodcastid>987654321</podtrac:itunespodcastid>'."\n";
    break;

    mobile-learning is the slug name of one of your categories (or maybe not) and 987654321 is an example for an iTunes ID.
    You can modify both to your needs.
    Edit also the other section and copy and paste one of these sections 5 times. Afterwards insert the slug names and the iTunes of the other category feeds.

    (If you have trouble doing this then post the 7 category slug names and the related iTunes IDs and I will help you with this part.)

    Tim

  7. drezac
    Member
    Posted 3 years ago #

    Okay- here's what I did: The Razor's Ed SHow on the bottom doesn't have an itunes id yet. (day or two).

    [Code moderated as per the Forum Rules. Please use the pastebin]

  8. ntm
    Member
    Plugin Author

    Posted 3 years ago #

    That looks okay to me. It should work.

  9. drezac
    Member
    Posted 3 years ago #

    Thanks! Quick check. I uploaded that to my site. Now what I checked, and I don't know how long this takes, but when I choose iTunes on this Podtrac player, it still takes me to the generic iTunes version, and not the one that will count for my itunes ID:

    Here's the podtrac player for EdGamer:
    http://player.podtrac.com/player?button=play&type=link&feed=http%3a%2f%2ffeeds.podtrac.com%2foyH2cGOkYb4%24

    Here's the RSS Feed validation. It says there's an error on line 2:
    http://www.feedvalidator.org/check.cgi?url=http://edreach.us/category/edgamer/feed/

    Thanks again, for working this out with me. I think we're almost there.

    Dan

  10. ntm
    Member
    Plugin Author

    Posted 3 years ago #

    when I choose iTunes on this Podtrac player

    I don't understand what you do. Where do choose iTunes? I cannot see any button or option on this where one could choose iTunes.

    it still takes me to the generic iTunes version, and not the one that will count for my itunes ID:

    What is the generic iTunes version? Version of what?

    All I know is that you can assemble/configure a player on this page: http://player.podtrac.com/player/configure
    The player should show and play the episodes from the RSS or OPML feed which you can/should define (where it says "or enter an RSS/OPML feed URL:")
    There you should enter the feed URL like this one: http://edreach.us/category/edgamer/feed/

    BTW: you can add this player easily to the sidebar of your blog. On this page where you can configure the player is a link called "Finished customizing your player? SHARE YOUR PLAYER". If you click on that link or if you click on the one of the four square icons right of Play button of the player which says "Embed" then a window or frame opens and you can see 1-2 lines of code (<script ... </script>). Copy that code and paste it into a Text Widget of your blog. The text Widget is a default widget of WP and shows text or embeds such code.

    It says there's an error on line 2:

    No. It does not say that there are 2 errors. It says that the feed is valid and that there are two issue which maybe solved differently. But the first recommendation is related to the Podtrac namespace definition. The validator shows you that because it does not know this particular namespace as you can read when you follow the [help] link at the end of the notice. It is more a problem of that validator and not of your feed.
    The other recommendation is not related to podPress nor to the mini Podtrac plugin.

    Furthermore if you scroll to line 24 of the code of your feed then you will see that the little Podtrac plugin works and that it has added the ID to this feed.

  11. drezac
    Member
    Posted 3 years ago #

    it still takes me to the generic iTunes version, and not the one that will count for my itunes ID:

    When you click on the player it sends the user to the itpc link. From Apple::

    itpc://FEEDURL

    Also note that this method will not push your podcast up the various charts in the iTunes Store and it is not eligible for the iTunes Affiliate Program. It is a direct call to the user's iTunes client software and sends no information to the iTunes Store. If you want to increase the visibility of your podcast and earn money through the iTunes Affiliate Program, we recommend that your web site and other marketing materials use the iTunes Store link described above.

    According to podtrac, when you add the itunespodcastid to the RSS, it's supposed to send you to the correct iTunes link, but it's not. Frustrating...

    Enable New Subscriptions through Podtrac Player to Increment Counts in iTunes
    Background: iTunes ranks audio and video podcasts by number of new subscribers to an RSS feed, among other factors. In order for the iTunes to count a subscription (toward this rank or otherwise), the subscription request must come from the publisher’s page in iTunes via a Podcast ID assigned by iTunes to the publisher. By default, the iTunes subscription link in Podtrac Player subscribes a user to the podcast without the Podcast ID.
    Optional Addition to Your RSS Feed: To enable subscriptions coming from Podtrac Player to increment iTunes subscription counts, Podtrac recommends publishers include the iTunes Podcast ID in RSS feeds by adding the following tag using the format below:
    channel <podtrac:itunespodcastid>123456789</podtrac: itunespodcastid>
    where "123456789" is the Podcast ID assigned by iTunes

    What did we miss?

    Dan

  12. ntm
    Member
    Plugin Author

    Posted 3 years ago #

    Okay, I understand now. But I'm pretty sure that the mini plugin works as suggested in the Podtrac documentation. I would say that your feeds contain the necessary tags and information and I really don't know why the player does not show the iTunes link with the iTunes ID.

    I have tried to find a further podcast which uses this <podtrac:itunespodcastid> tag. But so far I have not found one.

    You should ask the guys at Podtrac whether the feed should contain further information and whether the existing information are in the right format.

    Also if you want to try it, you may install the current Development Version. It contains minor modifications which will format the namespace section at the beginning of each feed a little bit different. I don't think that it will help. But maybe the Podtrac player is a little bit strict in interpreting the code of the feeds.

    Tim

  13. drezac
    Member
    Posted 3 years ago #

    Thanks again. I've put in some requests to Podtrac, but I see the Podtrac ID there.

    My wonder is if Podtrac wants me to submit the Podtrac Feed to iTunes rather than my own Podcast RSS feed. I don't want to give my feed away to Podtrac, so I'm not all interested in that.

    I was interested in the iTunes subscriptions counts. Let's see if they get back to me. Thanks so much for your help.

    Dan

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags