WordPress.org

Ready to get started?Download WordPress

Forums

podPress
Possible to include itunes content in atom feed? (23 posts)

  1. bstritesky
    Member
    Posted 3 years ago #

    Is it at all possible to include the same iTunes meta podcast information in the Atom feed as in the RSS feed? The reason I ask is that I am trying to have just one WordPress post have multiple media files, one audio and one video, each with their own separate podcast.

    Currently I'm having the audio in the RSS and the video in the Atom feed, but this is not desirable because the Atom feed does not include the Itunes meta information and also does not respect the Publish date but rather always uses the "last updated" instant. I would love to be able to have the Atom feed mirror the RSS in at least these two ways.

    I tried doing this myself by hacking some of the PHP files but I don't know enough code to get this accomplished. I'm hoping it can be done. Thanks!

  2. ntm
    Member
    Plugin Author

    Posted 3 years ago #

    Do I understand it right? You want to have a RSS feed with posts which containing only audio episodes and one RSS feed with posts which containing only video episodes.
    One way to achieve this is to put the posts which containing video files in one category and the posts which containing only audio episodes into a different category.
    WP offers a RSS feed for each category like http://www.example.com/category/audiopodcasts/feed/ or http://www.example.com/category/videopodcasts/feed/ where audiopodcasts and videopodcasts are the slug names of the category names (if you do use the default permalink structure the addresses would look like http://www.example.com/?feed=rss2&cat=1).
    podPress adds all the iTunes information like in the main RSS feed or in the RSS feed with the name Podcast to the category feeds, too.

    You could additionally use the CategoryCasting feature of podPress which hides in Site Admin > Posts > Categories. You will see this feature if you edit a category. This feature gives you the possibility to changes the channel information of a category feed.

    Regards,
    Tim

  3. bstritesky
    Member
    Posted 3 years ago #

    You've understood it right. I could figure out category casting, but that just means I have to have twice as many posts. I would like to have just one post be able to create both podcasts, otherwise it could become a maintenance nightmare to have to modify multiple posts.

    It's kind of possible by having the split between RSS2 for Audio and Atom for Video podcasts. I was just hoping there would be a way to include the itunes information in the Atom podcast.

    Thanks for all you do in maintaining PodPress.

  4. ntm
    Member
    Plugin Author

    Posted 3 years ago #

    The iTunes tags are RSS tags resp. a special namespace for RSS feeds.

    [...]I would like to have just one post be able to create both podcasts, [...]

    Now, I really understand what you want to do.

    Currently, podPress creates a feed with the name Enhanced Podcast which includes only posts which have .m4a or .m4v files as attachments. This feed is an ATOM feed.
    If your audio files are mp3 files and your video files are m4v files then you will get one feed which contains the posts with the mp3 files and one which contains the posts with the video files.
    It is important that the mp3 files are marked as attachments for the RSS feeds because RSS feeds have the disadvantage that their <item> elements can only have one enclosure and podPress will add only the marked files to the RSS feeds. (It is only possible to mark one file per post for RSS feeds.)
    podPress creates the Enhanced Podcast feed on the basis of the file name extensions and uses the ATOM feed schema because the comparable ATOM feed element (<entry>) can contain more than one enclosure. iTunes (the software on your computer) can handle ATOM feeds without these special iTunes tags and takes the information from the post and probably from the media files.
    Maybe this is a solution for you.

    If you want to hack podPress then should look into the podpress.php file and watch out for the add_feed() functions. For instance there is line $podpress_allowed_ext = Array('m4a', 'm4v'); where you can change easily the file name extensions for the filter and instead of the current subtitle of this feed you can change it to something else by modifying one of the following lines (add_filter('wp_title_rss', 'podpress_extend_m4x_feed_title');). podpress_extend_m4x_feed_title is simple function which return only the sub title. This function is in the podpress_feed_functions.php file but you can define such a function also in podpress.php.

    function podpress_extend_m4x_feed_title($title) {
    	return sprintf(__('%1$s - m4a/m4v Feed', 'podpress'), $title);
    }

    I know that you are not the only one who likes to make different feeds for different media file types. That is why it is possible that one of the next podPress versions might have additional settings which will make such hacks superfluous. (But I can not tell your when this version will be released. But I will add a notice to this thread when there is a usable beta version.)

    Regards,
    Tim

  5. bstritesky
    Member
    Posted 3 years ago #

    Thanks for this response. I actually did that hacking and it basically has the same result as just flagging the .mp4 (Video) to be included in the Atom version only. Either way it ends up in the Atom feed, just with a different feed path.

    I suppose the ultimate ideal solution would be to be able to specify multiple RSS2 podcasts within a single post. THAT would rock.

    In our situation, our church publishes both a sermon audio and sermon video podcast with a description. It would be very convenient to specify that the .mp3 media file goes to RSS2 Podcast for Audio and the .mp4 media file goes to RSS2 Podcast for Video, predefined already.

    I assume that this would require a lot of code change because the whole backbone of PodPress is built on the assumption of a single Podcast.

  6. ntm
    Member
    Plugin Author

    Posted 3 years ago #

    I assume that this would require a lot of code change because the whole backbone of PodPress is built on the assumption of a single Podcast.

    Well, I have not formed a complete idea yet. But I will probably build something with the file extension filter and maybe a dynamic table on the feed/iTunes settings page where it is possible to add/remove custom feeds, to set filter rules, the feed sub titles and the feed types - something to manage these custom feeds. That is probably a lot of work and the reason why I don't want to say when it will be ready. But later (tomorrow) I will try to give you some hints on how to make this Enhanced Podcast feed a RSS feed.

    Regards,
    Tim

  7. bstritesky
    Member
    Posted 3 years ago #

    That would be wonderful. Thanks!

    The reason it would be great to specify separate feeds is that the two obviously have different titles ("EMBC Sermon Audio" and "EMBC Sermon Video"), but each can share the description, author, and so on.

  8. ntm
    Member
    Plugin Author

    Posted 3 years ago #

    A little how-to hack podPress files to get an custom RSS feed on the basis of media file name extensions:

    (Line numbers are valid if you use podPress 8.8.6.3)

    podpress.php line 237:

    add_feed('enhancedpodcast', 'podPress_do_feed_enhanced_podcast');

    'enhancedpodcast' is the slug (name) of the feed. e.g. http://www.example.com/?feed=enhancedpodcast
    If you change it use only alpha-numeric ASCII characters (and no white spaces. Underscore and dashes are allowed.)

    podpress.php start at line 693
    old:

    function podPress_do_feed_enhanced_podcast($withcomments) {
    	// this function creates a ATOM feed which contains only posts which have m4a or m4v files attached with podPress
    	GLOBAL $wp_query, $podpress_allowed_ext;
    	podPress_addFeedHooks();
    	// get only posts with podPress attachments
    	define('PODPRESS_PODCASTSONLY', true);
    	// make sure that only the podPress attachment which is a torrent file will be an enclosure in the ATOM item
    	$podpress_allowed_ext = Array('m4a', 'm4v');
    	// get only posts with m4a/m4v files
    	podpress_only_posts_with_certain_files($wp_query, $podpress_allowed_ext);
    	add_filter('wp_title_rss', 'podpress_extend_m4x_feed_title');
    	if (!function_exists('do_feed_atom') OR TRUE == version_compare('2.3', $wp_version,'>')) {
    		load_template(ABSPATH.PLUGINDIR.'/podpress/wp-atom1.php');
    	} else {
    		do_feed_atom($withcomments);
    	}
    }

    a RSS feed with post with .mp4 files:
    new:

    function podPress_do_feed_enhanced_podcast($withcomments) {
    	// this function creates a RSS feed which contains only posts which have m4a or m4v files attached with podPress
    	GLOBAL $wp_query, $podpress_allowed_ext;
    	podPress_addFeedHooks();
    	// get only posts with podPress attachments
    	define('PODPRESS_PODCASTSONLY', true);
    	// make sure that only the podPress attachment which is a torrent file will be an enclosure in the RSS item
    	$podpress_allowed_ext = Array('mp4');
    	// get only posts with mp4 files
    	podpress_only_posts_with_certain_files($wp_query, $podpress_allowed_ext);
    	add_filter('wp_title_rss', 'podpress_extend_mp4_feed_title');
    	do_feed_rss2($withcomments);
    }

    add a function to modify the subtitle of this feed:

    function podpress_extend_mp4_feed_title() {
    	return sprintf(__('%1$s - mp4 Feed', 'podpress'), $title);
    }

    Furthermore modify the podpress_feed_functions.php file like this:
    old:

    if ( is_array($podpress_allowed_ext) ) {
    	if (FALSE == in_array($post->podPressMedia[$key]['ext'], $podpress_allowed_ext)) {
    		continue;
    	}
    }

    new:

    if ( is_array($podpress_allowed_ext) ) {
    	if (FALSE == in_array($post->podPressMedia[$key]['ext'], $podpress_allowed_ext)) {
    		continue;
    	} else {
    		$preferredFormat = true;
    	}
    }

    The new feed will have the description and other information from the feed/iTunes settings page of podPress.

  9. ntm
    Member
    Plugin Author

    Posted 3 years ago #

    BTW: I had a further idea and I will probably add this file extension filter to the Categoy Casting settings. It is probably the easiest way to implement this. Because the Category Casting settings are already the infrastructure - except the feed name add-on and the filter.
    It would be necessary to add the posts to the categories.

  10. bstritesky
    Member
    Posted 3 years ago #

    Your filtering integration enhancement sounds very nice indeed! I would just create two categories, audio and video, and ensure that both get listed in the single post. Then the filter would ensure that the Audio and Video podcasts are separate in their media content, but can share pretty much everything else, such as description, author, etc. Is my understanding correct? It would be nice to have free-text filtering options so that any file extension could be used.

  11. ntm
    Member
    Plugin Author

    Posted 3 years ago #

    I have uploaded 8.8.7 beta 3. It is the current Development Version. If you like to test this version and you how-to rollback if necessary then feel free to download it.

    This version has a possibility to limit the file types of the attachments in Category Feeds (currently only for RSS Feed).
    If your posts have both audio and video files and you want to have one Feed which contains the posts and only the audio files and one with posts with video files then add to your posts the categories e.g. "Audio Podcast" and "Video Podcast". After you have create these categories (which may have different names), activate the CategoryCasting feature for each of these categories. At the end of the options table is a new select box for the file types. Select e.g. MP3-Audio for the "Audio Podcast" category and MP4-Video for the "Video Podcast" category. That's it.
    You can find the link for each category at the beginning of the Category Casting sections. If the the Link has not your current permalink structure then empty this URl field and save the settings two times.
    Now, the "Video Podcast" feed should only contain posts of this category with MP4 files and so on ...

    If you have tested already with these category feeds clear or update the cache of your feed reader software (e.g. if it is FireFox).

    8.8.7 beta 3 resp. 8.8.7 has in combination with WP 2.8+ multiple widgets support. This means that you need to configure the podPress widgets (again) after the upgrade.

    The Feed Buttons Widget in 8.8.7 will probably have some options for the Category Feeds.

    Regards,
    Tim

  12. ntm
    Member
    Plugin Author

    Posted 3 years ago #

    Now, the Feed Buttons widget of the current Development Version includes options to display links of the category feeds in the sidebar. These options are only visible if you have activated the CategoryCasting feature for at least one category.

  13. bstritesky
    Member
    Posted 3 years ago #

    Thanks for doing all this work. I'll have to take a look at the development version when I have some spare time. I haven't tested development versions before, but I imagine I should back up the MySQL database and the files before attempting to use the dev version?

  14. ntm
    Member
    Plugin Author

    Posted 3 years ago #

    Yes, you are right. Before you test the Development Version, you should make a backup and prepare a copy of the last stable version of podPress. The development version uses a different way to implement the widgets if you use podPress in combination with WP 2.8 or a newer version. This means that you need to configure the widgets after the upgrade (and the same if you make roll-back). The other modifications of a db entry will be the additional file type setting of the CategoryCasting feature.

    I definitely like hear your opinion about this new version.

    I will do some more tests myself in the next days and if you have suggestions or run into a problem I will try to add or fix it as quick as possible.

  15. ntm
    Member
    Plugin Author

    Posted 3 years ago #

    If you are using the XSPF player constants in podpress.php then you should save this file, too. The new podPress version will bring also changes in this area. (see the new podpress_xspf_config-sample.php file and the XSPF widgets settings)

  16. webtrix
    Member
    Posted 3 years ago #

    Hello, I have a similar dilemma. I am using Podpress 8.8.6.3 to manage the sermons from my church. I have been managing them direct on the website, but now we are promoting subscription via feed and I created an iTunes podcast. Most of the messages are part of a series, so I have ONE post wiht the Series name, then multiple MP3 in the post... the feed is only pulling ONE audio file. Since I didn't understand most of what was written above, I would say I am looking for a very simple solution. I would like to continue to post them like I am because the workflow is much easier. Anyway this could work with Podpress or do I need to find another plugin?

    Appreciate any input, thank you!!!
    Dan Rollins
    http://www.strongdisciple.com

  17. ntm
    Member
    Plugin Author

    Posted 3 years ago #

    @webtrix: iTunes and other feed reader programs accept only the first media file in a RSS feed item resp. post probably because in the RSS specification is written that the enclosure element is "is an optional sub-element of" the RSS-<item>.
    You can read more about the multiple enclosures per RSS-<item> in part 1 and part 2 of a summarizing blog post.
    Because of this limitation podPress allows only to mark one media file as part of the RSS feed and reattaches all non-podPress enclosures of a post after the podPress media file (since v8.8.5).

    ATOM feeds have no such limitation and I guess it is worth to try to hand the ATOM feed of your blog to the iTunes repository.
    But these iTunes-tags are only defined for RSS feeds. That is why the iTunes client program tries to take the post specific information from the post itself.

    Regards,
    Tim

  18. ntm
    Member
    Plugin Author

    Posted 3 years ago #

    I have tested to subscribe with my iTunes client to an ATOM feed of my test blog which has also posts with multiple media files. It possible but iTunes takes also only one media file per post.

    I guess the only solution is to have only one media file per post. That is also in other ways useful see: http://wordpress.org/support/topic/plugin-podpress-ideas-on-placing-large-amounts-of-mp3s

  19. bstritesky
    Member
    Posted 3 years ago #

    Wow, the newest version is great!

    One more request, do you think it would be possible to have a different media file directory for each podcast type? Currently my audio and video feeds are in two different folders, so it would be super convenient for it to be able to look to separate directories per feed.

    Thanks again for all your hard work, it is very much appreciated.

  20. ntm
    Member
    Plugin Author

    Posted 3 years ago #

    Do you use the "Absolute path of the media files directory (optional)" option?
    Do you use it to get this comfortable to use dropdown list for selecting a file?

    Well, that is something I like to improve. But at the moment, I think more about a different element to select files - a custom file picker dialog which allows also to switch between folders. I think jQuery UI Dialog and AJAX are good ingredients for such a file picker.
    But your question reminds me that I need make it possible to switch back from the usage of this "Absolute path of the media files directory (optional)" option.

    However, I'm confident that one of the next versions will include a solution which will make it easier to select the media files - also from different folders.

    Regards,
    Tim

  21. bstritesky
    Member
    Posted 3 years ago #

    Yes, I use the option. I do like the dropdown list as it is, but do see how this could be improved to browse files/directories.

    Even if a new file selection prompt is created, it would be nice to be able to give a default directory per feed. My audio feed will always have its files in directory A; my video feed will always have its files in directory B. It would be nice for it to just know that by default to make selection even quicker.

  22. bstritesky
    Member
    Posted 3 years ago #

    The suggestion above assumed a clear delineation in the podpress media section of each post between the various podpress feeds. I assume that the various feeds are not all shown in the podpress media area.

    Therefore it seems like a better idea to have a single "media file box" where you select all the media files for that post, and within the file selection dialog box, it would allow you to specify favorite folders, so I can quickly select my files from the audio folder and from the video folder.

    Does this seem attainable?

  23. ntm
    Member
    Plugin Author

    Posted 3 years ago #

    Well, I will probably change the design of the podPress box below the post/page editor not very much.
    If you do not use the "Absolute path of the media files directory (optional)" option (or if choose "Specify URL ..." in the dropdown list), there is usually a simply text input field to insert the full URL.
    My idea is to put a button or a link which says e.g. "Select a file" at the end of this row. A click on it will open a jQuery UI Dialog which will contain several elements to navigate through the files and folders. An address bar with a "Go to" button, a home button to return to the current uploads folder and a list of file and sub folder of the current folder. A click on a folder would load a list of the content of the sub or parent folder. A click on a file name in the file would close the dialog and insert the URL into the field.
    This file picker could be placed at every URL input field in the plugin.

    But to built-in a possibility to set some favourite folders, is a really good idea! Thanks!

    Regards,
    Tim

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags